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
CoordinatesThe source coordinates.
targetCoordinates
CoordinatesThe 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
CoordinatesThe base coordinates.
targetCoordinates
CoordinatesThe target coordinates.
unitOfLength
Coordinates.UnitOfLengthThe 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
CoordinatesThe geographic coordinates (latitude and longitude).
dateTimeOffset
DateTimeOffsetThe date and time for which to calculate the sunrise and sunset times.
sunriseOn
DateTimeOffsetOutputs the calculated sunrise time as a DateTimeOffset object.
sunsetOn
DateTimeOffsetOutputs the calculated sunset time as a DateTimeOffset object.