Beispiel #1
0
        public static long GetInterSectPointofTwoLinesect(GPoint ptFirstLnBeg, GPoint ptFirstLnEnd, GPoint ptSecondLnBeg,
                                                          GPoint ptSecondLnEnd, ref GPoint ptInsect)
        {
            double angleToPt  = ptFirstLnBeg.GetAngleToPt(ptFirstLnEnd);
            double angleToPt2 = ptSecondLnBeg.GetAngleToPt(ptSecondLnEnd);

            return(ApplyMath.GetInterSectPointofTwoLinesect(ptFirstLnBeg, angleToPt, ptSecondLnBeg, angleToPt2,
                                                            ref ptInsect));
        }
Beispiel #2
0
        public static long GetInterSectPointofTwoLinesect(GPoint ptFirstLnBeg, double dAngle1, GPoint ptSecondLnBeg,
                                                          double dAngle2, ref GPoint ptInsect)
        {
            dAngle1 = ApplyMath.MakeAngleTo2P(dAngle1);
            dAngle2 = ApplyMath.MakeAngleTo2P(dAngle2);
            long result;

            if (Math.Abs(dAngle1 - 90.0) < 1E-08 || Math.Abs(dAngle1 - 270.0) < 1E-08)
            {
                if (Math.Abs(dAngle2 - 90.0) < 1E-08 || Math.Abs(dAngle2 - 270.0) < 1E-08)
                {
                    result = 0L;
                }
                else
                {
                    double num = (ptFirstLnBeg.X - ptSecondLnBeg.X) / Math.Cos(dAngle2 * 0.017453292519943295);
                    ptInsect.X = ptFirstLnBeg.X;
                    ptInsect.Y = ptSecondLnBeg.Y + num * Math.Sin(dAngle2 * 0.017453292519943295);
                    result     = 1L;
                }
            }
            else if (Math.Abs(dAngle2 - 90.0) < 1E-08 || Math.Abs(dAngle2 - 270.0) < 1E-08)
            {
                double num2 = (ptSecondLnBeg.X - ptFirstLnBeg.X) / Math.Cos(dAngle1 * 0.017453292519943295);
                ptInsect.X = ptSecondLnBeg.X;
                ptInsect.Y = ptFirstLnBeg.Y + num2 * Math.Sin(dAngle1 * 0.017453292519943295);
                result     = 1L;
            }
            else if (Math.Abs(Math.Tan(dAngle1 * 0.017453292519943295) - Math.Tan(dAngle2 * 0.017453292519943295)) < 1E-08)
            {
                result = 0L;
            }
            else
            {
                double num3 = (ptSecondLnBeg.X - ptFirstLnBeg.X) / Math.Cos(dAngle1 * 0.017453292519943295);
                double num  = (ptFirstLnBeg.Y - ptSecondLnBeg.Y + num3 * Math.Sin(dAngle1 * 0.017453292519943295)) /
                              (Math.Sin(dAngle2 * 0.017453292519943295) -
                               Math.Tan(dAngle1 * 0.017453292519943295) * Math.Cos(dAngle2 * 0.017453292519943295));
                double num2 = num3 + num * Math.Cos(dAngle2 * 0.017453292519943295) / Math.Cos(dAngle1 * 0.017453292519943295);
                ptInsect.X = ptFirstLnBeg.X + num2 * Math.Cos(dAngle1 * 0.017453292519943295);
                ptInsect.Y = ptFirstLnBeg.Y + num2 * Math.Sin(dAngle1 * 0.017453292519943295);
                result     = 1L;
            }
            return(result);
        }
Beispiel #3
0
        public long GetInterSectPointofTwoLinesectWithHeightForTranSect(CLinesect lnObj, ref GPoint ptInsect)
        {
            long interSectPointofTwoLinesect = ApplyMath.GetInterSectPointofTwoLinesect(this.gpoint_0, this.gpoint_1,
                                                                                        lnObj.GetFirstPt(), lnObj.GetSecondPt(), ref ptInsect);
            long result;

            if (interSectPointofTwoLinesect == 0L)
            {
                result = interSectPointofTwoLinesect;
            }
            else
            {
                double num;
                ApplyMath.GetPointOnLineZ(lnObj.gpoint_0.X, lnObj.gpoint_0.Y, lnObj.gpoint_0.Z, lnObj.gpoint_1.X,
                                          lnObj.gpoint_1.Y, lnObj.gpoint_1.Z, ptInsect.X, ptInsect.Y, out num);
                ptInsect.Z = num;
                ApplyMath.GetPointOnLineZ(lnObj.gpoint_0.X, lnObj.gpoint_0.Y, lnObj.gpoint_0.M, lnObj.gpoint_1.X,
                                          lnObj.gpoint_1.Y, lnObj.gpoint_1.M, ptInsect.X, ptInsect.Y, out num);
                ptInsect.M = num;
                result     = 1L;
            }
            return(result);
        }
Beispiel #4
0
 public long GetInterSectPointofTwoLinesect(CLinesect lnObj, ref GPoint ptInsect)
 {
     return(ApplyMath.GetInterSectPointofTwoLinesect(this.gpoint_0, this.gpoint_1, lnObj.GetFirstPt(),
                                                     lnObj.GetSecondPt(), ref ptInsect));
 }
Beispiel #5
0
 public GPoint GetDroopPoint(GPoint objPoint)
 {
     return(ApplyMath.GetDroopPoint(this.gpoint_0, this.gpoint_1, objPoint));
 }