public float AngleBetween(Vector3 other)
        {
            Vector3 a = GetNormalised();
            Vector3 b = other.GetNormalised();

            float d = a.Dot(b);

            return((float)Math.Acos(d));
        }
Example #2
0
        //finds the angle between the vectors
        public float AngleBetween(Vector3 other)
        {
            // normalise the vectors
            Vector3 a = GetNormalised();
            Vector3 b = other.GetNormalised();
            // calculate the dot product
            float d = a.x * b.x + a.y * b.y + a.z * b.z;

            // return the angle between them
            return((float)Math.Acos(d));
        }