ApsGis.dll

Geodetic.IsValidBearingInDeg Method

Checks if the provided bearing (in decimal degrees) is valid, i.e. if it can be used in GIS calculations in the Geodetic coordinate system.

public static bool IsValidBearingInDeg(
   double bearingInDeg,
   out string errorMessage
);

Parameters

bearingInDeg
a bearing (in decimal degrees) to validate
errorMessage
an error message, passed by reference (out), that contains detailed information in case of the invalid bearing

Return Value

true - if the bearing is valid, false - if the bearing is invalid

Remarks

The valid bearing is a real number greater or equal to zero.

Example

This sample shows how to call the Geodetic.IsValidBearingInDeg method from C# code:

string errorMessage = String.Empty;
double bearingInDeg = 78.5;
            
if (Geodetic.IsValidBearingInDeg(bearingInDeg, out errorMessage))
{
    Console.WriteLine("Bearing is valid.");
}
else
{
    Console.WriteLine(errorMessage);
}

See Also

Geodetic Class | ApsGis Namespace