Transform a pair of coordinates from a SRS to another expressed as EPSG
codes

@param from
The EPSG code of the source SRS
@param to
The EPSG code of the destination SRS
@param xy
The pair of coordinates (x,y) or (lon,lat)
@return
971583
public double[] transform(String from, String to, double[] xy) {
		return GeotoolsUtils.transform(from, to, xy);
	}
646702
@Pure
	public static GeodesicPosition EL2_WSG84(double x, double y) {
		final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
				LAMBERT_2E_N,
				LAMBERT_2E_C,
				LAMBERT_2E_XS,
				LAMBERT_2E_YS);
		return NTFLambdaPhi_WSG84(ntfLambdaPhi.getX(), ntfLambdaPhi.getY());
	}
592911
public void moveTo(double x, double y, double z) {
		if (this.numTypesProperty.get()>0 && this.types[this.numTypesProperty.get()-1]==PathElementType.MOVE_TO) {
			this.coordsProperty[this.numCoordsProperty.get()-3].set(x);
			this.coordsProperty[this.numCoordsProperty.get()-2].set(y);
			this.coordsProperty[this.numCoordsProperty.get()-1].set(z);
		}
		else {
			ensureSlots(false, 3);
			this.types[this.numTypesProperty.get()] = PathElementType.MOVE_TO;
			this.numTypesProperty.set(this.numTypesProperty.get()+1);

			this.coordsProperty[this.numCoordsProperty.get()].set(x);
			this.numCoordsProperty.set(this.numCoordsProperty.get()+1);

			this.coordsProperty[this.numCoordsProperty.get()].set(y);
			this.numCoordsProperty.set(this.numCoordsProperty.get()+1);

			this.coordsProperty[this.numCoordsProperty.get()].set(z);
			this.numCoordsProperty.set(this.numCoordsProperty.get()+1);
		}
		this.graphicalBounds = null;
		this.logicalBounds = null;
	}
1105201
public static com.vividsolutions.jts.geom.Geometry toJts(Geometry geometry) throws JtsConversionException {
		if (geometry == null) {
			throw new  JtsConversionException("Cannot convert null argument");
		}
		int srid = geometry.getSrid();
		int precision = geometry.getPrecision();
		PrecisionModel model;
		if (precision == -1) {
			model = new PrecisionModel(PrecisionModel.FLOATING);
		} else {
			model = new PrecisionModel(Math.pow(10, precision));
		}
		GeometryFactory factory = new GeometryFactory(model, srid);
		com.vividsolutions.jts.geom.Geometry jts;

		String geometryType = geometry.getGeometryType();
		if (GeometryService.isEmpty(geometry)) {
			jts = createEmpty(factory, geometryType);
		} else if (Geometry.POINT.equals(geometryType)) {
			jts = factory.createPoint(convertCoordinates(geometry)[0]);
		} else if (Geometry.LINEAR_RING.equals(geometryType)) {
			jts = factory.createLinearRing(convertCoordinates(geometry));
		} else if (Geometry.LINE_STRING.equals(geometryType)) {
			jts = factory.createLineString(convertCoordinates(geometry));
		} else if (Geometry.POLYGON.equals(geometryType)) {
			Geometry[] geometries = geometry.getGeometries();
			if (null != geometries && geometries.length > 0) {
				LinearRing exteriorRing = (LinearRing) toJts(geometries[0]);
				LinearRing[] interiorRings = new LinearRing[geometries.length - 1];
				for (int i = 0; i < interiorRings.length; i++) {
					interiorRings[i] = (LinearRing) toJts(geometries[i + 1]);
				}
				jts = factory.createPolygon(exteriorRing, interiorRings);
			} else {
				jts = factory.createPolygon(null, null);
			}
		} else if (Geometry.MULTI_POINT.equals(geometryType)) {
			Point[] points = new Point[geometry.getGeometries().length];
			jts = factory.createMultiPoint((Point[]) convertGeometries(geometry, points));
		} else if (Geometry.MULTI_LINE_STRING.equals(geometryType)) {
			LineString[] lineStrings = new LineString[geometry.getGeometries().length];
			jts = factory.createMultiLineString((LineString[]) convertGeometries(geometry, lineStrings));
		} else if (Geometry.MULTI_POLYGON.equals(geometryType)) {
			Polygon[] polygons = new Polygon[geometry.getGeometries().length];
			jts = factory.createMultiPolygon((Polygon[]) convertGeometries(geometry, polygons));
		} else {
			throw new JtsConversionException("Cannot convert geometry: Unsupported type.");
		}

		return jts;
	}
857477
public static Geometry ST_Transform(Connection connection, Geometry geom, Integer codeEpsg) throws SQLException, CoordinateOperationException {
        if (geom == null) {
            return null;
        }
        if (codeEpsg == null) {
            throw new IllegalArgumentException("The SRID code cannot be null.");
        }
        if (crsf == null) {
            crsf = new CRSFactory();
            //Activate the CRSFactory and the internal H2 spatial_ref_sys registry to
            // manage Coordinate Reference Systems.
            crsf.getRegistryManager().addRegistry(srr);
        }
        srr.setConnection(connection);
        try {
            int inputSRID = geom.getSRID();
            if (inputSRID == 0) {
                throw new SQLException("Cannot find a CRS");
            } else {
                CoordinateReferenceSystem inputCRS = crsf.getCRS(srr.getRegistryName() + ":" + String.valueOf(inputSRID));
                CoordinateReferenceSystem targetCRS = crsf.getCRS(srr.getRegistryName() + ":" + String.valueOf(codeEpsg));
                if (inputCRS.equals(targetCRS)) {
                    return geom;
                }
                EPSGTuple epsg = new EPSGTuple(inputSRID, codeEpsg);
                CoordinateOperation op = copPool.get(epsg);
                if (op != null) {
                    Geometry outPutGeom = geom.copy();
                    outPutGeom.geometryChanged();
                    outPutGeom.apply(new CRSTransformFilter(op));
                    outPutGeom.setSRID(codeEpsg);
                    return outPutGeom;
                } else {
                    if (inputCRS instanceof GeodeticCRS && targetCRS instanceof GeodeticCRS) {
                        Set<CoordinateOperation> ops = CoordinateOperationFactory
                                .createCoordinateOperations((GeodeticCRS) inputCRS, (GeodeticCRS) targetCRS);
                        if (!ops.isEmpty()) {
                            op = CoordinateOperationFactory.getMostPrecise(ops);
                            Geometry outPutGeom = (Geometry) geom.copy();
                            outPutGeom.geometryChanged();
                            outPutGeom.apply(new CRSTransformFilter(op));
                            copPool.put(epsg, op);
                            outPutGeom.setSRID(codeEpsg);
                            return outPutGeom;
                        }
                    } else {
                        throw new SQLException("The transformation from "
                                + inputCRS + " to " + codeEpsg + " is not yet supported.");
                    }
                }
            }
        } catch (CRSException ex) {
            throw new SQLException("Cannot create the CRS", ex);
        } finally {
            srr.setConnection(null);
        }
        return null;

    }
179853
public GeoPoint toLatLng2(Point point) {
        point = toWgs84(point);
        GeoPoint latLng = new GeoPoint(point.getY(), point.getX());
        return latLng;
    }
136371
public static void toGeojsonCoordinate(Coordinate coord, StringBuilder sb) {
        sb.append("[");
        sb.append(coord.x).append(",").append(coord.y);
        if (!Double.isNaN(coord.z)) {
            sb.append(",").append(coord.z);
        }
        sb.append("]");
    }
992550
public Transformation2D copy() {
		Transformation2D result = new Transformation2D();
		result.xx = xx;
		result.xy = xy;
		result.xd = xd;
		result.yx = yx;
		result.yy = yy;
		result.yd = yd;
		return result;
	}
584947
function XYZToLngLat([x, y, z]) {
  const lat = Math.atan2(z, Math.sqrt(x * x + y * y));
  const lng = Math.atan2(y, x);

  return [lng * RADIAN_TO_DEGREE, lat * RADIAN_TO_DEGREE];
}
755931
public static CoordinateReferenceSystem getCrsFromEpsg( String epsgPlusCode, Boolean doLatitudeFirst ) {
        String sridString = epsgPlusCode.replaceFirst("EPSG:", "").replaceFirst("epsg:", "");
        int srid = Integer.parseInt(sridString);
        return getCrsFromSrid(srid, doLatitudeFirst);
    }
376932
def ss_to_xy(s: str):
    """"""
    result = re.match(r'\$*([A-Z]+)\$*([0-9]+)', s, re.I)
    if result == None:
        return None
    xstring = result.group(1).upper()
    multiplier = 1
    x = 0
    for i in xstring:
        x = x * multiplier + (ord(i) - 64)
        multiplier = multiplier * 26
    x = x - 1
    y = int(result.group(2))-1
    return (x,y)
759706
function fromXYZ(x, y, z) {
    var color = create();
    setXYZ(color, x, y, z);
    return color;
}
576680
public double toScreenY(double y)
    {
        Point2D src = srcPnt.get();
        Point2D dst = dstPnt.get();
        src.setLocation(0, y);
        combinedTransform.transform(src, dst);
        return dst.getY();
    }
1090689
public static int crossShape (IShape s, float x, float y) {
        if (!s.bounds().contains(x, y)) {
            return 0;
        }
        return crossPath(s.pathIterator(null), x, y);
    }
379649
public Vector3f transformPosition(float x, float y, float z, Vector3f dest) {
        dest.x = x;
        dest.y = y;
        dest.z = z;
        return dest.mulPosition(this);
    }
313652
@SuppressWarnings("unchecked")
    public GoogleMapShape toShape(Geometry geometry) {

        GoogleMapShape shape = null;

        GeometryType geometryType = geometry.getGeometryType();
        switch (geometryType) {
            case POINT:
                shape = new GoogleMapShape(geometryType,
                        GoogleMapShapeType.LAT_LNG, toLatLng((Point) geometry));
                break;
            case LINESTRING:
                shape = new GoogleMapShape(geometryType,
                        GoogleMapShapeType.POLYLINE_OPTIONS,
                        toPolyline((LineString) geometry));
                break;
            case POLYGON:
                shape = new GoogleMapShape(geometryType,
                        GoogleMapShapeType.POLYGON_OPTIONS,
                        toPolygon((Polygon) geometry));
                break;
            case MULTIPOINT:
                shape = new GoogleMapShape(geometryType,
                        GoogleMapShapeType.MULTI_LAT_LNG,
                        toLatLngs((MultiPoint) geometry));
                break;
            case MULTILINESTRING:
                shape = new GoogleMapShape(geometryType,
                        GoogleMapShapeType.MULTI_POLYLINE_OPTIONS,
                        toPolylines((MultiLineString) geometry));
                break;
            case MULTIPOLYGON:
                shape = new GoogleMapShape(geometryType,
                        GoogleMapShapeType.MULTI_POLYGON_OPTIONS,
                        toPolygons((MultiPolygon) geometry));
                break;
            case CIRCULARSTRING:
                shape = new GoogleMapShape(geometryType,
                        GoogleMapShapeType.POLYLINE_OPTIONS,
                        toPolyline((CircularString) geometry));
                break;
            case COMPOUNDCURVE:
                shape = new GoogleMapShape(geometryType,
                        GoogleMapShapeType.MULTI_POLYLINE_OPTIONS,
                        toPolylines((CompoundCurve) geometry));
                break;
            case CURVEPOLYGON:
                shape = new GoogleMapShape(geometryType,
                        GoogleMapShapeType.POLYGON_OPTIONS,
                        toCurvePolygon((CurvePolygon) geometry));
                break;
            case POLYHEDRALSURFACE:
                shape = new GoogleMapShape(geometryType,
                        GoogleMapShapeType.MULTI_POLYGON_OPTIONS,
                        toPolygons((PolyhedralSurface) geometry));
                break;
            case TIN:
                shape = new GoogleMapShape(geometryType,
                        GoogleMapShapeType.MULTI_POLYGON_OPTIONS,
                        toPolygons((TIN) geometry));
                break;
            case TRIANGLE:
                shape = new GoogleMapShape(geometryType,
                        GoogleMapShapeType.POLYGON_OPTIONS,
                        toPolygon((Triangle) geometry));
                break;
            case GEOMETRYCOLLECTION:
                shape = new GoogleMapShape(geometryType,
                        GoogleMapShapeType.COLLECTION,
                        toShapes((GeometryCollection<Geometry>) geometry));
                break;
            default:
                throw new GeoPackageException("Unsupported Geometry Type: "
                        + geometryType.getName());
        }

        return shape;
    }
780346
public static void xyzToSrgb( float x , float y , float z , float srgb[] ) {
		srgb[0] = 3.240479f*x - 1.53715f*y - 0.498535f*z;
		srgb[1] = -0.969256f*x + 1.875991f*y + 0.041556f*z;
		srgb[2] = 0.055648f*x - 0.204043f*y + 1.057311f*z;
	}