Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions GeoUK/Coordinates/EastingNorthing.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
using GeoUK.Ellipsoids;
using GeoUK.Projections;

namespace GeoUK.Coordinates
{
/// <summary>
Expand Down Expand Up @@ -62,5 +65,19 @@ public double DistanceTo(EastingNorthing toEastingNorthing)
double deltaHeight = toEastingNorthing.Height - Height;
return System.Math.Sqrt(horizontal * horizontal + deltaHeight * deltaHeight);
}

/// <summary>
/// Creates a <see cref="EastingNorthing"/> object from latitude and longitude coordinates.
/// </summary>
/// <param name="latitude"></param>
/// <param name="longitude"></param>
/// <returns></returns>
Comment on lines +72 to +74

Copilot AI Feb 18, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter documentation is missing descriptions. The similar method FromEastingNorthing in LatitudeLongitude.cs provides descriptive parameter documentation (lines 83-84) that explains the parameter meaning and units. For consistency and API clarity, please add descriptions for the latitude and longitude parameters, including their expected units (degrees) and any range constraints if applicable.

Suggested change
/// <param name="latitude"></param>
/// <param name="longitude"></param>
/// <returns></returns>
/// <param name="latitude">
/// The geodetic latitude in degrees, positive north of the equator; typically in the range -90 to 90.
/// </param>
/// <param name="longitude">
/// The geodetic longitude in degrees, positive east of the Prime Meridian; typically in the range -180 to 180.
/// </param>
/// <returns>
/// A new <see cref="EastingNorthing"/> representing the projected British National Grid coordinates
/// corresponding to the specified latitude and longitude.
/// </returns>

Copilot uses AI. Check for mistakes.
public static EastingNorthing FromLatitudeLongitude(double latitude, double longitude)
{
Cartesian cartesian = Convert.ToCartesian(new Wgs84(), new LatitudeLongitude(latitude, longitude));
Cartesian bngCartesian = Transform.Etrs89ToOsgb36(cartesian);

return Convert.ToEastingNorthing(new Airy1830(), new BritishNationalGrid(), bngCartesian);
}
Comment thread
IeuanWalker marked this conversation as resolved.
}
}