BuildingCoder.CmdDetailCurves.ProjectPointOntoPlane C# (CSharp) Method

ProjectPointOntoPlane() private method

Return a point projected onto a plane defined by its normal. http://www.euclideanspace.com/maths/geometry/elements/plane Case 1259133 [Curve must be in the plane]
private ProjectPointOntoPlane ( XYZ point, XYZ planeNormal ) : XYZ
point XYZ
planeNormal XYZ
return XYZ
        XYZ ProjectPointOntoPlane(
            XYZ point,
            XYZ planeNormal)
        {
            double a = planeNormal.X;
              double b = planeNormal.Y;
              double c = planeNormal.Z;

              double dx = ( b * b + c * c ) * point.X - ( a * b ) * point.Y - ( a * c ) * point.Z;
              double dy = -( b * a ) * point.X + ( a * a + c * c ) * point.Y - ( b * c ) * point.Z;
              double dz = -( c * a ) * point.X - ( c * b ) * point.Y + ( a * a + b * b ) * point.Z;
              return new XYZ( dx, dy, dz );
        }