// (C)2007 Attila Kovacs <attila@submm.caltech.edu>



public class Mercator extends SphericalProjection {

	public Mercator() {}

	public String getFitsID() { return fitsID; }

	public String getFullName() { return fullName; }

	@Override
	public final void getOffsets(double theta, double phi, CoordinatePair toOffset) {
		toOffset.x = phi;
		toOffset.y = Math.log(Math.tan(45.0*Unit.deg + 0.5*theta));
	}

	@Override
	public final double phi(CoordinatePair offset) { 
		return offset.x;
	}

	@Override
	public final double theta(CoordinatePair offset) {
		return 2.0 * Math.atan(Math.exp(offset.y)) - 90.0*Unit.deg;
	}

	
	
	public final static String fitsID = "MER";
	public final static String fullName = "Mercator";
}