Transform a coordinate from view space to pan space.

@param coordinate
The views pace coordinate.
@return Returns the pan space equivalent of the given coordinate.
3564
public Coordinate viewToPan(Coordinate coordinate) {
		if (coordinate != null) {
			Vector2D position = new Vector2D(coordinate);
			double scale = mapView.getCurrentScale();
			Coordinate panOrigin = mapView.getPanOrigin();
			
			double translateX = (mapView.getViewState().getX() - panOrigin.getX()) * scale - (mapView.getWidth() / 2);
			double translateY = -(mapView.getViewState().getY() - panOrigin.getY()) * scale - (mapView.getHeight() / 2);
			position.translate(translateX , translateY);
				// TODO: implement rotation support.
			return new Coordinate(position.getX(), position.getY());
		}
		return null;
	}
274977
protected Rectangle getRectOnScreen (JComponent comp)
    {
        Rectangle r = comp.getVisibleRect();
        Point p = comp.getLocationOnScreen();
        r.translate(p.x, p.y);
        return r;
    }
122795
public static void reproject( CoordinateReferenceSystem from, CoordinateReferenceSystem to, Coordinate[] coordinates )
            throws Exception {
        MathTransform mathTransform = CRS.findMathTransform(from, to);

        for( int i = 0; i < coordinates.length; i++ ) {
            coordinates[i] = JTS.transform(coordinates[i], coordinates[i], mathTransform);
        }
    }
657246
public double getDistance(Coordinate coordinate) {
		double distance = Double.MAX_VALUE;
		if (!isEmpty()) {
			for (LinearRing interiorRing : interiorRings) {
				double d = interiorRing.getDistance(coordinate);
				if (d < distance) {
					distance = d;
				}
			}
			double d = exteriorRing.getDistance(coordinate);
			if (d < distance) {
				distance = d;
			}
		}
		return distance;
	}
586925
public static com.vividsolutions.jts.geom.Coordinate toJts(org.geomajas.geometry.Coordinate coordinate)
			throws JtsConversionException {
		if (coordinate == null) {
			throw new  JtsConversionException("Cannot convert null argument");
		}
		return new com.vividsolutions.jts.geom.Coordinate(coordinate.getX(), coordinate.getY());
	}
723231
public RectF getZoomedRect() {
        if (mScaleType == ScaleType.FIT_XY) {
            throw new UnsupportedOperationException("getZoomedRect() not supported with FIT_XY");
        }
        PointF topLeft = transformCoordTouchToBitmap(0, 0, true);
        PointF bottomRight = transformCoordTouchToBitmap(viewWidth, viewHeight, true);

        float w = getDrawable().getIntrinsicWidth();
        float h = getDrawable().getIntrinsicHeight();
        return new RectF(topLeft.x / w, topLeft.y / h, bottomRight.x / w, bottomRight.y / h);
    }
61867
protected void convertFromARtoVRSpace(float scale) {
        mPose.update(mAnchor.getPose(), scale);
        getTransform().setModelMatrix(mPose.getPoseMatrix());
    }
1361738
public Coordinate tileTopLeft(int tx, int ty, int zoomLevel) {
        int px = tx * tileSize;
        int py = ty * tileSize;
        Coordinate result = pixelsToMeters(px, py, zoomLevel);
        return result;
    }
19991
public Bbox transform(Matrix t) {
		Coordinate c1 = transform(t, new Coordinate(x, y));
		Coordinate c2 = transform(t, new Coordinate(x + width, y + height));
		Coordinate origin = new Coordinate(Math.min(c1.getX(), c2.getX()), Math.min(c1.getY(), c2.getY()));
		Coordinate endPoint = new Coordinate(Math.max(c1.getX(), c2.getX()), Math.max(c1.getY(), c2.getY()));
		return new Bbox(origin.getX(), origin.getY(), endPoint.getX() - origin.getX(), endPoint.getY() - origin.getY());
	}
560296
public Point toWgs84(Point point) {
        if (projection != null) {
            point = toWgs84.transform(point);
        }
        return point;
    }
1137490
public void setCenterPoint(Coordinate coordinate) {
		this.x = coordinate.getX() - 0.5 * this.width;
		this.y = coordinate.getY() - 0.5 * this.height;
	}
1024
public double getValueAt( Coordinate coordinate ) {
        if (geodata == null) {
            throw new IllegalArgumentException("The data have first to be read!");
        }
        int[] coordinateToNearestRowCol = GrassLegacyUtilities.coordinateToNearestRowCol(inWindow, coordinate);
        if (coordinateToNearestRowCol != null) {
            int row = coordinateToNearestRowCol[0];
            int col = coordinateToNearestRowCol[1];
            if (row > 0 && row < geodata.length) {
                if (col > 0 && col < geodata[0].length) {
                    return geodata[row][col];
                }
            }
        }
        return HMConstants.doubleNovalue;
    }
905921
public static BoundingBox getProjectedBoundingBox(Projection projection,
			long x, long y, int zoom) {

		BoundingBox boundingBox = getWebMercatorBoundingBox(x, y, zoom);

		if (projection != null) {
			ProjectionTransform transform = webMercator
					.getTransformation(projection);
			boundingBox = boundingBox.transform(transform);
		}

		return boundingBox;
	}
971583
public double[] transform(String from, String to, double[] xy) {
		return GeotoolsUtils.transform(from, to, xy);
	}
268158
protected Coordinate calculatePosition(double scale, Coordinate rescalePoint) {
		ViewPort viewPort = mapPresenter.getViewPort();
		Coordinate position = viewPort.getPosition();
		double dX = (rescalePoint.getX() - position.getX()) * (1 - 1 / scale);
		double dY = (rescalePoint.getY() - position.getY()) * (1 - 1 / scale);
		return new Coordinate(position.getX() + dX, position.getY() + dY);
	}
373992
public static Geometry scaleToUnitaryArea( Geometry polygon ) throws Exception {
        double area = polygon.getArea();
        double scale = sqrt(1.0 / area);
        AffineTransform scaleAT = new AffineTransform();
        scaleAT.scale(scale, scale);
        AffineTransform2D scaleTransform = new AffineTransform2D(scaleAT);
        polygon = JTS.transform(polygon, scaleTransform);
        return polygon;
    }
463348
@Override
	public String getOrientationName(int index) {
		if (getAxisTransformation().getRotationGroup().getPointGroup().equals("C2")) {
			if (index == 0) {
				return "Front C2 axis";
			} else if (index == 2) {
				return "Back C2 axis";
			}
		}
		return getPolyhedron().getViewName(index);
	}