Class CoordinatesExtensions

Namespace
SIMDispatcher.Core.Extensions
Assembly
SIMDispatcher.Core.dll
public static class CoordinatesExtensions
Inheritance
CoordinatesExtensions
Inherited Members

Methods

DistanceTo(Coordinates, Coordinates)

Calculates the distance between two coordinates using kilometers as the default unit.

public static double DistanceTo(this Coordinates source, Coordinates targetCoordinates)

Parameters

source Coordinates

The source coordinates.

targetCoordinates Coordinates

The target coordinates.

Returns

double

The distance between the source and target coordinates in kilometers.

DistanceTo(Coordinates, Coordinates, UnitOfLength)

Calculates the distance between two coordinates using the specified unit of length.

public static double DistanceTo(this Coordinates baseCoordinates, Coordinates targetCoordinates, Coordinates.UnitOfLength unitOfLength)

Parameters

baseCoordinates Coordinates

The base coordinates.

targetCoordinates Coordinates

The target coordinates.

unitOfLength Coordinates.UnitOfLength

The unit of length to use for calculating the distance.

Returns

double

The distance between the base and target coordinates in the specified unit.

GetSunriseAndSunset(Coordinates, DateTimeOffset, out DateTimeOffset, out DateTimeOffset)

Calculates the sunrise and sunset times for the specified geographic coordinates and date.

public static void GetSunriseAndSunset(this Coordinates coordinates, DateTimeOffset dateTimeOffset, out DateTimeOffset sunriseOn, out DateTimeOffset sunsetOn)

Parameters

coordinates Coordinates

The geographic coordinates (latitude and longitude).

dateTimeOffset DateTimeOffset

The date and time for which to calculate the sunrise and sunset times.

sunriseOn DateTimeOffset

Outputs the calculated sunrise time as a DateTimeOffset object.

sunsetOn DateTimeOffset

Outputs the calculated sunset time as a DateTimeOffset object.