| 50 | double rad_to_deg(double r) { return (r * 180.0 / PI); } |
| 51 | double deg_to_rad(double d) { return (d * PI / 180.0); } |
| 52 | double get_angle(PT a, PT b) { |
| 53 | double costheta = dot(a, b) / a.norm() / b.norm(); |
| 54 | return acos(max((double)-1.0, min((double)1.0, costheta))); |
| 55 | } |
| 56 | bool is_point_in_angle(PT b, PT a, PT c, PT p) { // does point p lie in angle <bac |
| 57 | assert(orientation(a, b, c) != 0); |
| 58 | if (orientation(a, c, b) < 0) swap(b, c); |