예제 #1
0
파일: Line3D.cs 프로젝트: ProSuite/ProSuite
        /// <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));
        }
예제 #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));
        }