angleBetween is true when theta is in range [lower,upper] including the end points. Angles can be outside the [0,2PI) range.
(theta, lower, upper float64)
| 99 | |
| 100 | // angleBetween is true when theta is in range [lower,upper] including the end points. Angles can be outside the [0,2PI) range. |
| 101 | func angleBetween(theta, lower, upper float64) bool { |
| 102 | if upper < lower { |
| 103 | // sweep is false, ie direction is along negative angle (clockwise) |
| 104 | lower, upper = upper, lower |
| 105 | } |
| 106 | theta = angleNorm(theta - lower + Epsilon) |
| 107 | upper = angleNorm(upper - lower + 2.0*Epsilon) |
| 108 | return theta <= upper |
| 109 | } |
| 110 | |
| 111 | // angleBetweenExclusive is true when theta is in range (lower,upper) excluding the end points. Angles can be outside the [0,2PI) range. |
| 112 | func angleBetweenExclusive(theta, lower, upper float64) bool { |