Exemplo n.º 1
0
        /// <summary>
        /// The perpendicular distance of the infinite line defined by the Start/End points of this
        /// line to the specified point.
        /// </summary>
        /// <param name="point"></param>
        /// <returns></returns>
        public double GetDistancePerpendicular(Pnt3D point)
        {
            var sp = new Line3D(StartPoint, point);

            Vector vectorProduct = GeomUtils.CrossProduct(DirectionVector,
                                                          sp.DirectionVector);

            return(Math.Abs(vectorProduct.Length / DirectionVector.Length));
        }
Exemplo n.º 2
0
        public bool IsParallel(Plane3D other)
        {
            double e = Math.Max(Epsilon, other.Epsilon);

            Vector crossProduct = GeomUtils.CrossProduct(Normal, other.Normal);

            return(MathUtils.AreEqual(crossProduct.X, 0, e) &&
                   MathUtils.AreEqual(crossProduct.Y, 0, e) &&
                   MathUtils.AreEqual(crossProduct[2], 0, e));
        }