Table of Contents

Class Conversion

Namespace
ThinkGeo.Core
Assembly
ThinkGeo.Core.dll

This static class provides a conversion method to go to and from different units.

public static class Conversion
Inheritance
Conversion
Inherited Members

Remarks

None

Methods

ConvertAngleUnits(double, AngleUnit, AngleUnit)

public static double ConvertAngleUnits(double angle, AngleUnit fromUnit, AngleUnit toUnit)

Parameters

angle double
fromUnit AngleUnit
toUnit AngleUnit

Returns

double

ConvertGeographyUnitToDistanceUnit(GeographyUnit)

This method returns a DistanceUnit that has been converted from a GeographyUnit.

public static DistanceUnit ConvertGeographyUnitToDistanceUnit(GeographyUnit unit)

Parameters

unit GeographyUnit

The GeographyUnit you want to convert.

Returns

DistanceUnit

This method returns a DistanceUnit that has been converted from a GeographyUnit.

Remarks

None

Exceptions

ArgumentOutOfRangeException

If you pass in a GeographyUnit that is not defined in the enumeration, it will throw an ArgumentOutOfRangeException.

ConvertMeasureUnits(double, AreaUnit, AreaUnit)

This method converts from one unit of measure to another.

public static double ConvertMeasureUnits(double amount, AreaUnit fromUnit, AreaUnit toUnit)

Parameters

amount double

The total area size, represented in the unit specified in the fromUnit parameter.

fromUnit AreaUnit

The unit of measure for the area in the Amount parameter.

toUnit AreaUnit

The unit of measure for the result.

Returns

double

The return area size, represented in the unit specified in the toUnit parameter.

Remarks

None

Exceptions

ArgumentOutOfRangeException

If you pass in a fromUnit that is not defined in the enumeration, it will throw an ArgumentOutOfRangeException.

ArgumentOutOfRangeException

If you pass in a toUnit that is not defined in the enumeration, it will throw an ArgumentOutOfRangeException.

ConvertMeasureUnits(double, DistanceUnit, DistanceUnit)

This method converts from one unit of measure to another.

public static double ConvertMeasureUnits(double amount, DistanceUnit fromUnit, DistanceUnit toUnit)

Parameters

amount double

The total length size, represented in the unit specified in the fromUnit parameter.

fromUnit DistanceUnit

The unit of measure for the length in the Amount parameter.

toUnit DistanceUnit

The unit of measure for the result.

Returns

double

The return length size, represented in the unit specified in the toUnit parameter.

Remarks

None

Exceptions

ArgumentOutOfRangeException

If you pass in a fromUnit that is not defined in the enumeration, it will throw an ArgumentOutOfRangeException.

ArgumentOutOfRangeException

If you pass in a toUnit that is not defined in the enumeration, it will throw an ArgumentOutOfRangeException.