Glare.Plane3d.Intersect C# (CSharp) Method

Intersect() public method

Get the intersection point between the three planes.
public Intersect ( Plane3d b, Plane3d c ) : Vector3d
b Plane3d
c Plane3d
return Vector3d
        public Vector3d Intersect( Plane3d b,  Plane3d c )
        {
            Vector3d result;
                    Vector3d v1, v2, v3;
                    Vector3d cross;

                    b.Normal.Cross(ref c.Normal, out cross);

                    var f = -Normal.Dot(ref cross);

                    v1 = cross *  Distance ;

                    c.Normal.Cross(ref Normal, out cross);
                    v2 = cross *  b.Distance ;

                    Normal.Cross(ref b.Normal, out cross);
                    v3 = cross *  c.Distance ;

                    result.X = (Double)( (v1.X + v2.X + v3.X) / f );
                    result.Y = (Double)( (v1.Y + v2.Y + v3.Y) / f );
                    result.Z = (Double)( (v1.Z + v2.Z + v3.Z) / f );

                    return result;
        }

Same methods

Plane3d::Intersect ( Plane3d &b, Plane3d &c, Vector3d &result ) : void