Sanitize and validate a navigational bearing
This application normalizes and validates a given decimal bearing. A bearing, or navigational azimuth, describes a direction or, the angular measurement, in a spherical coordinate system. Bearings are used in many operations in KML Workbench, thus the need for functions that normalize and validate user input. Similar to latitude and longitude, the Bearing::isValid() function first calls KMLWB::sanitizeGeo() for security. Here, I call Bearing::normalize() to convert the given input to a floating point decimal between 0 and 360.
The result will be a valid, normalized bearing or "Invalid bearing". If valid, KML will be generated displaying a 100 km path from 0°,0° in the direction of the bearing.