Ejemplo n.º 1
0
        /// <summary>
        /// Finds the angle in radians between the Vector3 and specified other Vector3.
        /// </summary>
        /// <param name="compareTo">Other Vector3 to compare to for angle calculation.</param>
        public float AngleBetween(Vector3 compareTo)
        {
            // Normalize both Vector3s
            Vector3 a = GetNormalized();
            Vector3 b = compareTo.GetNormalized();

            return((float)Math.Acos(a.Dot(b)));
        }
Ejemplo n.º 2
0
        public float AngleBetween(Vector3 other)
        {
            Vector3 a = GetNormalized();
            Vector3 b = other.GetNormalized();

            float d = a.Dot(b);

            return((float)Math.Acos(d));
        }
Ejemplo n.º 3
0
        float AngleBetween(Vector3 other)
        {
            Vector3 a = GetNormalized();
            Vector3 b = other.GetNormalized();

            float d = a.x * b.x + a.y * b.y + a.z * b.z;

            return((float)Math.Acos(d));
        }