示例#1
0
        public Segment Clone()
        {
            Segment s = new Segment
            {
                P1       = this.P1.Clone(),
                P2       = this.P2.Clone(),
                theColor = this.theColor
            };

            if (this.Motion != null)
            {
                Motion = this.Motion.Clone();
            }
            return(s);
        }
示例#2
0
 //find a point which is dist off the end of a line segment
 public static PointPlus ExtendSegment(Point P1, Point P2, float dist, bool firstPt)
 {
     if (firstPt)
     {
         Vector v            = P2 - P1;
         double changeLength = (v.Length + dist) / v.Length;
         v = Vector.Multiply(changeLength, v);
         PointPlus newPoint = new PointPlus {
             P = P2 - v
         };
         return(newPoint);
     }
     else
     {
         Vector v            = P1 - P2;
         double changeLength = (v.Length + dist) / v.Length;
         v = Vector.Multiply(changeLength, v);
         PointPlus newPoint = new PointPlus {
             P = P1 - v
         };
         return(newPoint);
     }
 }
示例#3
0
 public Segment(PointPlus P1i, PointPlus P2i, ColorInt theColori)
 {
     P1       = P1i;
     P2       = P2i;
     theColor = theColori;
 }