ApsNadcon .NET Library

ApsNadcon.IsValidLongitude Method

Checks if the provided longitude (in decimal degrees) is valid.

public static bool IsValidLongitude(
   double lonInDeg,
   out string errorMessage
);

Parameters

lonInDeg
a longitude (in decimal degrees) to validate
errorMessage
an error message, passed by reference (out), that contains detailed error / warning information

Return Value

true - if the longitude is valid, false - if it is invalid

Remarks

The valid longitude is a real number in the range from -180.0 (inclusive) to 180.0 (inclusive).

Example

This sample shows how to call the ApsNadcon.IsValidLongitude method from C# code:

double lonInDeg = -120.1313;

string errorMessage = String.Empty;
            
if (ApsNadcon.IsValidLongitude(lonInDeg, out errorMessage))
{
    Console.WriteLine("Longitude is valid.");
}
else
{
    Console.WriteLine(errorMessage);
}

See Also

ApsNadcon Class | ApsNadcon Namespace