public void Add(PVector v) { X += v.X; Y += v.Y; }
public static double AngleBetweenDegrees(PVector a, PVector b) { return(a.AngleWithDegrees(b)); }
public static PVector GetFromRotationDegrees(PVector a, double degrees) { return(PVector.GetFromRotationRadians(a, degrees.ToRadians())); }
public static double DistanceBetween(PVector a, PVector b) { return(a.DistanceTo(b)); }
public static double AngleBetweenRadians(PVector a, PVector b) { return(a.AngleWithRadians(b)); }
public double AngleWithRadians(PVector b) { return(Math.Atan2(b.Y - Y, b.X - X)); }
public double AngleWithDegrees(PVector b) { return(AngleWithRadians(b).ToDegrees()); }
public PLine(double x1, double y1, double x2, double y2) { Start = new PVector(x1, y1); End = new PVector(x2, y2); }
public void RotateGeometry(PVector basePoint, double angle) { Start.RotateGeometry(basePoint, angle); End.RotateGeometry(basePoint, angle); }
public PLine(PVector s, PVector e) { Start = s; End = e; }
public double DistanceFromPoint(PVector p) { return(PVector.DistanceBetween(p, ClosesetPoint(p))); }
public bool ContainsClosestPoint(PVector p) { var v = ClosesetPoint(p); return(PVector.DistanceBetween(v, Start) <= Length && PVector.DistanceBetween(v, End) <= Length); }