private static int FindExtremePoint(List <JVector> points, ref JVector dir) { int index = 0; float current = float.MinValue; JVector point; float value; for (int i = 1; i < points.Count; i++) { point = points[i]; value = JVector.Dot(ref point, ref dir); if (value > current) { current = value; index = i; } } return(index); }
/// <summary> /// Calculates the dot product of two vectors. /// </summary> /// <param name="value1">The first vector.</param> /// <param name="value2">The second vector.</param> /// <returns>Returns the dot product of both.</returns> #region public static float operator *(JVector value1, JVector value2) public static float operator *(JVector value1, JVector value2) { return(JVector.Dot(ref value1, ref value2)); }
/// <summary> /// Calculates the dot product of two vectors. /// </summary> /// <param name="vector1">The first vector.</param> /// <param name="vector2">The second vector.</param> /// <returns>Returns the dot product of both vectors.</returns> #region public static float Dot(JVector vector1, JVector vector2) public static float Dot(JVector vector1, JVector vector2) { return(JVector.Dot(ref vector1, ref vector2)); }