예제 #1
0
        public bool IsOnShortLine(clsPoint pt1, double aTol = 0, bool excludeEnds = false)
        {
            clsLine l1 = default(clsLine);
            clsLine l2 = default(clsLine);
            double  d  = 0;

            if (aTol == 0)
            {
                aTol = mdlGeometry.myTol;
            }
            if (Abs(pt1.Dist(this)) > aTol)
            {
                return(false);
            }
            l1 = new clsLine(P1, pt1);
            l2 = Copy();
            l2.Normalise();
            d = l1.Dot(l2);
            if (d < -aTol)
            {
                return(false);
            }
            if (d > Length + aTol)
            {
                return(false);
            }
            if (excludeEnds && (P1 == pt1 | P2 == pt1))
            {
                return(false);
            }
            return(true);
        }
예제 #2
0
        public double Dist(clsLine l1)
        {
            clsLine l2 = default(clsLine);
            clsLine l3 = default(clsLine);

            l2 = l1.Normal();
            l3 = new clsLine(l1.P1, this);
            return(Abs(l2.Dot(l3)));
        }
예제 #3
0
        public static double Dist(clsPoint p1, clsLine l1)
        {
            //+ve for outside the wall, left handed; Also, +ve for above straight.
            clsLine l2 = new clsLine();
            clsLine l3 = new clsLine();

            l2 = (clsLine)l1.Normal();
            l3 = new clsLine(l1.P1, p1);

            return(l2.Dot(l3));
        }
예제 #4
0
        public double VerticalHeight(clsPoint pt1)
        {
            //Returns the height of the line where is passes over p1
            clsLine l1 = default(clsLine);
            clsLine l2 = default(clsLine);
            double  d  = 0;
            double  d1 = 0;
            double  d2 = 0;

            l1 = new clsLine(P1.X, P1.Y, P2.X, P2.Y);
            if (l1.IsOnLine(pt1) == false)
            {
                return(0);
            }

            d1 = l1.Length;
            l1.Normalise();

            l2 = new clsLine(l1.P1, pt1);
            d2 = l1.Dot(l2);
            d  = d2 / d1;
            return(P1.Z + (P2.Z - P1.Z) * d);
        }
예제 #5
0
        public bool IsOnHalfLine(clsPoint pt1, double aTol = 0)
        {
            clsLine l1 = default(clsLine);
            clsLine l2 = default(clsLine);
            double  d  = 0;

            if (aTol == 0)
            {
                aTol = mdlGeometry.myTol;
            }
            if (Abs(pt1.Dist(this)) > aTol)
            {
                return(false);
            }
            l1 = new clsLine(P1, pt1);
            l2 = Copy();
            l2.Normalise();
            d = l1.Dot(l2);
            if (d < -aTol)
            {
                return(false);
            }
            return(true);
        }