GetNormal() public méthode

get Normal by vector
public GetNormal ( ) : Vector
Résultat Vector
Exemple #1
0
        /// <summary>
        /// get angle of two vector
        /// </summary>
        /// <param name="lhs">first vector</param>
        /// <param name="rhs">second vector</param>
        /// <returns> angle of two vector</returns>
        public static double GetAngleOf2Vectors(Vector lhs, Vector rhs, bool acuteAngleDesired)
        {
            double angle = Math.Acos(lhs.GetNormal() * rhs.GetNormal());

            if (acuteAngleDesired && angle > Math.PI / 2)
            {
                angle = Math.PI - angle;
            }
            return(angle);
        }
Exemple #2
0
 /// <summary>
 /// get angle of two vector
 /// </summary>
 /// <param name="lhs">first vector</param>
 /// <param name="rhs">second vector</param>
 /// <returns> angle of two vector</returns>
 public static double GetAngleOf2Vectors(Vector lhs, Vector rhs, bool acuteAngleDesired)
 {
     double angle = Math.Acos(lhs.GetNormal() * rhs.GetNormal());
     if (acuteAngleDesired && angle > Math.PI / 2)
     {
         angle = Math.PI - angle;
     }
     return angle;
 }