<-- Previous || Up || Next -->

Direction To Degrees Function
Math Miscellaneous Class

Public Function DirectionToDegrees( _
    ByVal vDirection As Variant _
    ) As Variant

Converts the abbreviation for a compass direction (N, SW, ENE, etc.) into a measurement in degrees (between 0 and 360).

    DirectionToDegrees("N") = 0
    DirectionToDegrees("SW") = 225
    DirectionToDegrees("ENE") = 67.5
    DirectionToDegrees("WHAT") = -1 ' #4.
    DirectionToDegrees("EW") = -1 ' #5.
See also:
    DegreesToDirection Function
    SpellDirection Function
vDirection: String containing an abbreviation for one of the 16 possible compass directions. Function returns Null if vDirection is Null of cannot be fixed up to a String.
Note: These are the well-formed directions accepted by this function: E, ENE, ESE, N, NE, NNE, NNW, NW, S, SE, SSE, SSW, SW, W, WNW, and WSW. Function returns -1 if vDirection is not one of those sixteen direction abbreviations as in examples #4 and #5.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.