示例#1
0
 public void Add(PVector v)
 {
     X += v.X;
     Y += v.Y;
 }
示例#2
0
 public static double AngleBetweenDegrees(PVector a, PVector b)
 {
     return(a.AngleWithDegrees(b));
 }
示例#3
0
 public static PVector GetFromRotationDegrees(PVector a, double degrees)
 {
     return(PVector.GetFromRotationRadians(a, degrees.ToRadians()));
 }
示例#4
0
 public static double DistanceBetween(PVector a, PVector b)
 {
     return(a.DistanceTo(b));
 }
示例#5
0
 public static double AngleBetweenRadians(PVector a, PVector b)
 {
     return(a.AngleWithRadians(b));
 }
示例#6
0
 public double AngleWithRadians(PVector b)
 {
     return(Math.Atan2(b.Y - Y, b.X - X));
 }
示例#7
0
 public double AngleWithDegrees(PVector b)
 {
     return(AngleWithRadians(b).ToDegrees());
 }
示例#8
0
 public PLine(double x1, double y1, double x2, double y2)
 {
     Start = new PVector(x1, y1);
     End   = new PVector(x2, y2);
 }
示例#9
0
 public void RotateGeometry(PVector basePoint, double angle)
 {
     Start.RotateGeometry(basePoint, angle);
     End.RotateGeometry(basePoint, angle);
 }
示例#10
0
 public PLine(PVector s, PVector e)
 {
     Start = s;
     End   = e;
 }
示例#11
0
 public double DistanceFromPoint(PVector p)
 {
     return(PVector.DistanceBetween(p, ClosesetPoint(p)));
 }
示例#12
0
        public bool ContainsClosestPoint(PVector p)
        {
            var v = ClosesetPoint(p);

            return(PVector.DistanceBetween(v, Start) <= Length && PVector.DistanceBetween(v, End) <= Length);
        }