Hot answers tagged


Let s1 and s2 the segments, so you can calculate the angle of each using atan2(s.p1.y-s.p2.y,s.p1.x-s.p2.x) where p1 and p2 are the two points defining s; double theta1 = Math.atan2(s1.p1.y-s1.p2.y,s1.p1.x-s1.p2.x); double theta2 = Math.atan2(s2.p1.y-s2.p2.y,s2.p1.x-s2.p2.x); Taking the absolute value of the difference, you get the angle between the ...

Only top voted, non community-wiki answers of a minimum length are eligible