public static int Dot(StepVector3 lhs, StepVector3 rhs) { return (lhs.x * rhs.x + lhs.y * rhs.y + lhs.z * rhs.z); }
public static long DotLong(StepVector3 lhs, StepVector3 rhs) { return ((long)lhs.x * (long)rhs.x + (long)lhs.y * (long)rhs.y + (long)lhs.z * (long)rhs.z); }
/** Angle between the vectors in radians */ public static float Angle(StepVector3 lhs, StepVector3 rhs) { double cos = Dot(lhs, rhs) / ((double)lhs.magnitude * (double)rhs.magnitude); cos = cos < -1 ? -1 : (cos > 1 ? 1 : cos); return((float)System.Math.Acos(cos)); }
public static StepVector2 FromInt3XZ(StepVector3 o) { return(new StepVector2(o.x, o.z)); }
public static float Distance(StepVector3 a, StepVector3 b) { return((a - b).magnitude); }