Example #1
0
 public static double AngleBetween(Vector3d from, Vector3d to)
 {
     return(Mathd.Acos(Mathd.Clamp(Dot(from.normalized, to.normalized), -1d, 1d)));
 }
Example #2
0
 public static Vector3d Max(Vector3d lhs, Vector3d rhs)
 {
     return(new Vector3d(Mathd.Max(lhs.x, rhs.x), Mathd.Max(lhs.y, rhs.y), Mathd.Max(lhs.z, rhs.z)));
 }
Example #3
0
 public static Vector3d Lerp(Vector3d from, Vector3d to, double t)
 {
     t = Mathd.Clamp01(t);
     return(new Vector3d(from.x + (to.x - from.x) * t, from.y + (to.y - from.y) * t, from.z + (to.z - from.z) * t));
 }
Example #4
0
 public static double Angle(Vector3d from, Vector3d to)
 {
     return(Mathd.Acos(Mathd.Clamp(Dot(from.normalized, to.normalized), -1d, 1d)) * 57.29578d);
 }
Example #5
0
 public static Vector2d Max(Vector2d lhs, Vector2d rhs)
 {
     return(new Vector2d(Mathd.Max(lhs.x, rhs.x), Mathd.Max(lhs.y, rhs.y)));
 }