Exemplo n.º 1
0
 public void AddPoint(clsPoint aPoint, int i = -1)
 {
     if (aPoint == null)
     {
         return;
     }
     if (i == -1)
     {
         myPoints.Add(aPoint.Copy());
     }
     else
     {
         myPoints.Insert(i, aPoint.Copy());
     }
 }
Exemplo n.º 2
0
 public clsArc(clsPoint aCentre, double aRadius, double anAngle1, double anAngle2, int aDirection)
 {
     Centre    = aCentre.Copy();
     Radius    = aRadius;
     Angle1    = anAngle1;
     Angle2    = anAngle2;
     Direction = aDirection;
 }
Exemplo n.º 3
0
 public void InsertPoint(clsPoint aPoint, int anIndex)
 {
     if (anIndex == -1 | anIndex > myPoints.Count)
     {
         anIndex = myPoints.Count;
     }
     myPoints.Insert(anIndex, aPoint.Copy());
 }
Exemplo n.º 4
0
        public static clsPoint ProjectPoint(clsPoint p1, clsLine l1)
        {
            double   d   = 0;
            clsPoint pt1 = new clsPoint();
            clsLine  l2  = new clsLine();

            d   = Dist(p1, l1);
            pt1 = p1.Copy();
            l2  = (clsLine)l1.Normal();
            l2.Normalise();
            l2.Scale(-d);
            pt1.Move(l2.P2.X, l2.P2.Y);
            return(pt1);
        }
Exemplo n.º 5
0
        public clsLine TangentToPointDown(clsPoint pt1)
        {
            //Goes on the downside of a transition down
            double  a;
            double  x;
            clsLine l1;

            if (pt1.x > Centre.x - mdlGeometry.myTol)
            {
                return(null);
            }
            a = Atan((Centre.y - pt1.y) / Abs((Centre.x - pt1.x)));
            x = Radius / pt1.Dist(Centre);
            if (x >= 1)
            {
                return(null);
            }

            a  = Acos(x) - a;
            l1 = new clsLine(pt1.Copy(), new clsPoint(Centre.x - Radius * Cos(a), Centre.y + Radius * Sin(a)));
            return(l1);
        }
Exemplo n.º 6
0
 public clsLine(clsPoint pt1, clsPoint pt2)
 {
     myP1 = pt1.Copy();
     myP2 = pt2.Copy();
 }
Exemplo n.º 7
0
 public clsCircle(clsPoint aCentre, double aRadius)
 {
     Centre = aCentre.Copy();
     Radius = aRadius;
 }