Math3D.AngleVectorPlane C# (CSharp) Method

AngleVectorPlane() public static method

public static AngleVectorPlane ( Vector3 vector, Vector3 normal ) : float
vector Vector3
normal Vector3
return float
    public static float AngleVectorPlane(Vector3 vector, Vector3 normal)
    {
        float dot;
        float angle;

        //calculate the the dot product between the two input vectors. This gives the cosine between the two vectors
        dot = Vector3.Dot(vector, normal);

        //this is in radians
        angle = (float)Math.Acos(dot);

        return 1.570796326794897f - angle; //90 degrees - angle
    }