angleBetweenExclusive is true when theta is in range (lower,upper) excluding the end points. Angles can be outside the [0,2PI) range.
(theta, lower, upper float64)
| 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 { |
| 113 | if upper < lower { |
| 114 | // sweep is false, ie direction is along negative angle (clockwise) |
| 115 | lower, upper = upper, lower |
| 116 | } |
| 117 | theta = angleNorm(theta - lower) |
| 118 | upper = angleNorm(upper - lower) |
| 119 | if 0.0 < theta && theta < upper { |
| 120 | return true |
| 121 | } |
| 122 | return false |
| 123 | } |
| 124 | |
| 125 | // snap "gridsnaps" the floating point to a grid of the given spacing |
| 126 | func snap(val, spacing float64) float64 { |