(coord: Coord)
| 230 | } |
| 231 | |
| 232 | fn to_polar(coord: Coord) -> Coord { |
| 233 | let r = f64::sqrt(coord.x.powi(2) + coord.y.powi(2)); |
| 234 | let mut theta = f64::atan2(coord.y, coord.x); |
| 235 | if theta < 0.0 { |
| 236 | theta += 2.0 * std::f64::consts::PI; |
| 237 | } |
| 238 | coord! { x: r, y: theta} |
| 239 | } |
| 240 | |
| 241 | fn scale_range(src: &[f64; 2], dst: &[f64; 2], v: f64) -> f64 { |
| 242 | (dst[1] - dst[0]) * (v - src[0]) / (src[1] - src[0]) + dst[0] |
nothing calls this directly
no outgoing calls
no test coverage detected