/// <summary> /// Convert the lat/lng into the cartesian coordinate plane such that all /// world coordinates are represented in the first quadrant. /// The x dimension corresponds to latitude and y corresponds to longitude. /// The translation starts with the normalized latlng and adds 180 to the latitude and /// 90 to the longitude (subject to fixed point scaling). /// </summary> public CartesianPoint ToCartesian() { LatLng ll = Normalize(); int lat = ll.GetFixedLat(); int lng = ll.GetFixedLng(); return(new CartesianPoint( lng + 180 * FixedLatLng.ScaleFactorInt, lat + 90 * FixedLatLng.ScaleFactorInt )); }
public FixedLatLng(LatLng ll) { _lat = ll.GetFixedLat(); _lng = ll.GetFixedLng(); }
public override LatLng CalculateMidpoint(LatLng other) { return new FixedLatLng((_lat + other.GetFixedLat())/2, (_lng + other.GetFixedLng())/2); }
public override LatLng CalculateMidpoint(LatLng other) { return(new FixedLatLng((_lat + other.GetFixedLat()) / 2, (_lng + other.GetFixedLng()) / 2)); }