posted 22 years ago
i wanna implement a operation that calculate a closest point to a Line from one point.
the signature of the operation should be
public Point getClosestPoint(Point p1, Point p2, Point target);
the point 1 and point 2 form a line , the method should return a point on the line that is closest to the target.
I just use some stupid method to do that.
Anyone have smart algoirthem or method to do it ?
Thanks for your help