public PVector ClosesetPoint(PVector p) { var a = FullVector.Copy(); a.RotateDegrees(90); a.Add(p); var newLine = new PLine(p, a); return(Intersection(newLine)); }
public PVector Intersection(PLine b) { if (M == b.M) { return(null); } else { var x = (b.B - B) / (M - b.M); var y = (M * b.B - b.M * B) / (M - b.M); return(new PVector(x, y)); } }