/// <summary> /// Instantiates GnommonicProjection. /// </summary> /// <param name="centerLongitude">Longitude of projection center</param> /// <param name="centerLatitude">Latitude of projection center</param> public GnomonicProjection(double centerLongitude, double centerLatitude) { _center = UnitSphere.LatLonToGeocentric(centerLatitude, centerLongitude); double[] center = { _center.X, _center.Y, _center.Z }; double[] vector = new double[3]; int k = getMinEntryIndex(center); int j = (k + 2) % 3; int i = (j + 2) % 3; vector[i] = -center[j]; vector[j] = center[i]; vector[k] = 0; _xAxis = (new Vector3(vector[0], vector[1], vector[2])).Unitize(); _yAxis = _center.CrossProduct(_xAxis); }
/// <summary> /// Instantiates GnommonicProjection. /// </summary> /// <param name="centerLongitude">Longitude of projection center</param> /// <param name="centerLatitude">Latitude of projection center</param> public GnomonicProjection(double centerLongitude, double centerLatitude) { _center = UnitSphere.LatLonToGeocentric(centerLatitude, centerLongitude); double[] center = { _center.X, _center.Y, _center.Z }; double[] vector = new double[3]; int k = getMinEntryIndex(center); int j = (k + 2) % 3; int i = (j + 2) % 3; vector[i] = -center[j]; vector[j] = center[i]; vector[k] = 0; _xAxis = (new Vector3(vector[0], vector[1], vector[2])).Unitize(); _yAxis = _center.CrossProduct(_xAxis); }