Source/NFX/Geometry/CartesianUtils.cs
/// <summary>
/// Converts a radian angular coordinate into map direction
/// </summary>
Converts a radian angular coordinate into map direction
Converts a radian angular coordinate into map direction
public static MapDirection AngleToMapDirection(double angle)
    {
       angle = WrapAngle(angle, 0);
       if ((angle >= 0.0d) && (angle < PI2 * 1d/16d)) return MapDirection.East;
       else
       if ((angle >= PI2 * 1d/16d) && (angle < PI2 * 3d/16d)) return MapDirection.NorthEast;
       else
       if ((angle >= PI2 * 3d / 16d) && (angle < PI2 * 5d / 16d)) return MapDirection.North;
       else
       if ((angle >= PI2 * 5d / 16d) && (angle < PI2 * 7d / 16d)) return MapDirection.NorthWest;
       else
       if ((angle >= PI2 * 7d / 16d) && (angle < PI2 * 9d / 16d)) return MapDirection.West;
       else
       if ((angle >= PI2 * 9d / 16d) && (angle < PI2 * 11d / 16d)) return MapDirection.SouthWest;
       else
       if ((angle >= PI2 * 11d / 16d) && (angle < PI2 * 13d / 16d)) return MapDirection.South;
       else
       if ((angle >= PI2 * 13d / 16d) && (angle < PI2 * 15d / 16d)) return MapDirection.SouthEast;
       else
         return MapDirection.East;
    }
public static MapDirection AngleToMapDirection ( double angle ) { angle = WrapAngle ( angle , 0 ) ; if ( ( angle >= 0.0d ) && ( angle < PI2 * 1d / 16d ) ) return MapDirection . East ; else if ( ( angle >= PI2 * 1d / 16d ) && ( angle < PI2 * 3d / 16d ) ) return MapDirection . NorthEast ; else if ( ( angle >= PI2 * 3d / 16d ) && ( angle < PI2 * 5d / 16d ) ) return MapDirection . North ; else if ( ( angle >= PI2 * 5d / 16d ) && ( angle < PI2 * 7d / 16d ) ) return MapDirection . NorthWest ; else if ( ( angle >= PI2 * 7d / 16d ) && ( angle < PI2 * 9d / 16d ) ) return MapDirection . West ; else if ( ( angle >= PI2 * 9d / 16d ) && ( angle < PI2 * 11d / 16d ) ) return MapDirection . SouthWest ; else if ( ( angle >= PI2 * 11d / 16d ) && ( angle < PI2 * 13d / 16d ) ) return MapDirection . South ; else if ( ( angle >= PI2 * 13d / 16d ) && ( angle < PI2 * 15d / 16d ) ) return MapDirection . SouthEast ; else return MapDirection . East ; }
Converts a radian angular coordinate into map direction
Converts a radian angular coordinate into map direction
angle
double