| 48 | return acos(max((double)-1.0, min((double)1.0, costheta))); |
| 49 | } |
| 50 | double cross2(PT a, PT b, PT c) { return cross(b - a, c - a); } |
| 51 | // intersection point between ab and cd assuming unique intersection exists |
| 52 | PT line_line_intersection(PT a, PT b, PT c, PT d) { |
| 53 | double a1 = a.y - b.y, b1 = b.x - a.x, c1 = cross(a, b); |