This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
    Bookmark Topic Watch Topic
  • New Topic

finding closest point

 
Yundi Li, Daniel
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please don't post the same question in multiple forums - other posters may waste their time replying to something that has already been answered elsewhere. Continue the discussion here. Thanks.
 
    Bookmark Topic Watch Topic
  • New Topic