I am looking at converting compass degrees to a string representing directions. There's another SO post to do this here.
This is one answer that modified slightly to represent the complete direction as a word Vs just the abbreviation, would anyone know how to convert this to a Python function? Im looking to have a string returned that represents the 8 cardinal directions... Answer by Edward Brey Feb 13 '19 at 18:29
function getCardinalDirection(angle) {
const directions = ['↑ North', '↗ North East', '→ East', '↘ South East', '↓ South', '↙ South West', '← West', '↖ North West'];
return directions[Math.round(angle / 45) % 8];
}