コード例 #1
0
 public static Vector3 Normalize(this IVector3 vector)
 => vector.Div(vector.Magnitude());
コード例 #2
0
 /// <summary>
 /// Normalize a vector
 /// </summary>
 /// <param name="v">Vector to be normalized</param>
 /// <param name="norm">Normalised vector</param>
 /// <returns>Normalized result vector a/|a|</returns>
 public static IVector3 Normalize(this IVector3 v, ref IVector3 norm)
 {
     return(v.Div(v.Magnitude(), ref norm));
 }