Skip to main content

ResQ.Core.Location

Location(double, double, Nullable<double>) Constructor

Represents a geographic location with latitude, longitude, and optional altitude.
public Location(double Latitude, double Longitude, System.Nullable<double> Altitude=null);

Parameters

Latitude System.Double Latitude in decimal degrees (-90 to 90). Longitude System.Double Longitude in decimal degrees (-180 to 180). Altitude System.Nullable<System.Double> Altitude in meters above sea level (optional).

Example

var location = new Location(37.7749, -122.4194); // San Francisco
var locationWithAlt = new Location(37.7749, -122.4194, 100.5);

// Calculate distance between two locations
var sf = new Location(37.7749, -122.4194);
var la = new Location(34.0522, -118.2437);
double distanceKm = sf.DistanceTo(la); // ~559 km

Remarks

This record provides a standard way to represent geographic coordinates throughout the ResQ system. It includes a method to calculate distance between locations using the Haversine formula for great-circle distance.