(yaw float32)
| 18 | ) |
| 19 | |
| 20 | func YawDirection(yaw float32) string { |
| 21 | normalizedYaw := NormalizeYaw(yaw) |
| 22 | if normalizedYaw >= 315.0 || normalizedYaw < 45.0 { |
| 23 | return DirectionPZ // North |
| 24 | } else if normalizedYaw >= 45.0 && normalizedYaw < 135.0 { |
| 25 | return DirectionPX // East |
| 26 | } else if normalizedYaw >= 135.0 && normalizedYaw < 225.0 { |
| 27 | return DirectionNZ // South |
| 28 | } else if normalizedYaw >= 225.0 && normalizedYaw < 315.0 { |
| 29 | return DirectionNX // West |
| 30 | } |
| 31 | |
| 32 | return "" |
| 33 | } |
| 34 | |
| 35 | func NormalizeYaw(yaw float32) float32 { |
| 36 | yaw = EuclideanRemainder(yaw, 360) |
nothing calls this directly
no test coverage detected