public static double AngleBetween(Vector3Double from, Vector3Double to) { return(Mathd.Acos(Mathd.Clamp(Vector3Double.Dot(from.normalized, to.normalized), -1d, 1d))); }
public static double Angle(Vector2d from, Vector2d to) { return(Mathd.Acos(Mathd.Clamp(Vector2d.Dot(from.normalized, to.normalized), -1d, 1d)) * 57.29578d); }
public static double AngleRadians(Vector3d from, Vector3d to) { return(Mathd.Acos(Mathd.Clamp(Vector3d.Dot(from.normalized, to.normalized), -1d, 1d))); }
/* * public override string ToString() * { * string fmt = "({0:F1}, {1:F1}, {2:F1}, {3:F1})"; * object[] objArray = new object[4]; * int index1 = 0; * // ISSUE: variable of a boxed type * __Boxed<double> local1 = (ValueType) this.x; * objArray[index1] = (object) local1; * int index2 = 1; * // ISSUE: variable of a boxed type * __Boxed<double> local2 = (ValueType) this.y; * objArray[index2] = (object) local2; * int index3 = 2; * // ISSUE: variable of a boxed type * __Boxed<double> local3 = (ValueType) this.z; * objArray[index3] = (object) local3; * int index4 = 3; * // ISSUE: variable of a boxed type * __Boxed<double> local4 = (ValueType) this.w; * objArray[index4] = (object) local4; * return UnityString.Format(fmt, objArray); * } * * public string ToString(string format) * { * string fmt = "({0}, {1}, {2}, {3})"; * object[] objArray = new object[4]; * int index1 = 0; * string str1 = this.x.ToString(format); * objArray[index1] = (object) str1; * int index2 = 1; * string str2 = this.y.ToString(format); * objArray[index2] = (object) str2; * int index3 = 2; * string str3 = this.z.ToString(format); * objArray[index3] = (object) str3; * int index4 = 3; * string str4 = this.w.ToString(format); * objArray[index4] = (object) str4; * return UnityString.Format(fmt, objArray); * } */ public static double Angle(QuaternionD a, QuaternionD b) { return((double)Mathd.Acos(Mathd.Min(Mathd.Abs(QuaternionD.Dot(a, b)), 1.0)) * 2.0 * 57.2957801818848); }
public static double Angle(Vector3d from, Vector3d to) { //return Mathd.Acos(Mathd.Clamp(Vector3d.Dot(from.normalized, to.normalized), -1d, 1d)) * 57.29578d; return(Mathd.Acos(Mathd.Clamp(Vector3d.Dot(from.normalized, to.normalized), -1d, 1d)) * 180.0 / Math.PI); }
public static double AngleBetween(DVector3 from, DVector3 to) { return(Mathd.Acos(Mathd.Clamp(DVector3.Dot(from.normalized, to.normalized), -1d, 1d))); }
public static double Angle(DVector3 from, DVector3 to) { return(Mathd.Acos(Mathd.Clamp(DVector3.Dot(from.normalized, to.normalized), -1d, 1d)) * 57.29578d); }