[kw-pm] Angle Label Algorithm

Robert Pike roberthpike at yahoo.com
Wed Apr 27 13:51:20 PDT 2011


Hey all,
     I'm looking for a flexible algorithm to determine where to place labels for angles. The program is in Java but it shouldn't take too much to convert from Perl to Java if need be. I have 2 adjacent angles adding up to a minimum of 50 to a maximum of 180 degrees. I have the coordinates (x1,y1 and x2,y2) for 3 lines making up the 2 angles (they share a side). The far right angle will always have it's bottom side "flat" on the x-axis and the angles rotate counter-clockwise. What's the easiest/effective way to determine the best position (that most clearly defines each angle) for each label?
     The top diagram here : http://www.mathsisfun.com/geometry/adjacent-angles.html or one of the diagrams on http://www.icoachmath.com/Sitemap/AdjacentAngles.html are 2 places to look at. I don't need to put arcs there just label the angles appropriately. Again, I have the x,y points for the 3 lines I'm drawing for the angles as seen on these sites. I want to keep the amount of code to a minimum so I'm trying to find something with less weight than what I've already got. Any suggestions would be appreciated. Thanks.
 
Rob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/kw-pm/attachments/20110427/27b8d7a8/attachment.html>


More information about the kw-pm mailing list