Canguro.Commands.Model.SelectLineCmd.cosAngle C# (CSharp) Method

cosAngle() private static method

private static cosAngle ( LineElement l1, LineElement l2 ) : float
l1 Canguro.Model.LineElement
l2 Canguro.Model.LineElement
return float
        private static float cosAngle(LineElement l1, LineElement l2)
        {
            bool negative = (l1.I.Id == l2.I.Id || l1.J.Id == l2.J.Id);
            Vector3 v1 = l1.I.Position - l1.J.Position;
            Vector3 v2 = l2.I.Position - l2.J.Position;
            v1.Normalize();
            v2.Normalize();

            return (negative) ? -Vector3.Dot(v1, v2) : Vector3.Dot(v1, v2);
        }