public void initialize() { super.initialize(); if (Math.abs(Math.abs(projectionLatitude) - MapMath.HALFPI) < EPS10) { mode = projectionLatitude < 0. ? SOUTH_POLE : NORTH_POLE; sinphi0 = projectionLatitude < 0. ? -1. : 1.; cosphi0 = 0.; } else if (Math.abs(projectionLatitude) < EPS10) { mode = EQUATOR; sinphi0 = 0.; cosphi0 = 1.; } else { mode = OBLIQUE; sinphi0 = Math.sin(projectionLatitude); cosphi0 = Math.cos(projectionLatitude); } if (!spherical) { en = MapMath.enfn(es); switch (mode) { case NORTH_POLE: Mp = MapMath.mlfn(MapMath.HALFPI, 1., 0., en); break; case SOUTH_POLE: Mp = MapMath.mlfn(-MapMath.HALFPI, -1., 0., en); break; case EQUATOR: case OBLIQUE: N1 = 1. / Math.sqrt(1. - es * sinphi0 * sinphi0); G = sinphi0 * (He = e / Math.sqrt(one_es)); He *= cosphi0; break; } } }
public void initialize() { double t; super.initialize(); if (Math.abs((t = Math.abs(projectionLatitude)) - ProjectionMath.HALFPI) < EPS10) mode = projectionLatitude < 0. ? SOUTH_POLE : NORTH_POLE; else mode = t > EPS10 ? OBLIQUE : EQUATOR; trueScaleLatitude = Math.abs(trueScaleLatitude); if (!spherical) { double X; switch (mode) { case NORTH_POLE: case SOUTH_POLE: if (Math.abs(trueScaleLatitude - ProjectionMath.HALFPI) < EPS10) akm1 = 2. * scaleFactor / Math.sqrt(Math.pow(1 + e, 1 + e) * Math.pow(1 - e, 1 - e)); else { akm1 = Math.cos(trueScaleLatitude) / ProjectionMath.tsfn(trueScaleLatitude, t = Math.sin(trueScaleLatitude), e); t *= e; akm1 /= Math.sqrt(1. - t * t); } break; case EQUATOR: akm1 = 2. * scaleFactor; break; case OBLIQUE: t = Math.sin(projectionLatitude); X = 2. * Math.atan(ssfn(projectionLatitude, t, e)) - ProjectionMath.HALFPI; t *= e; akm1 = 2. * scaleFactor * Math.cos(projectionLatitude) / Math.sqrt(1. - t * t); sinphi0 = Math.sin(X); cosphi0 = Math.cos(X); break; } } else { switch (mode) { case OBLIQUE: sinphi0 = Math.sin(projectionLatitude); cosphi0 = Math.cos(projectionLatitude); case EQUATOR: akm1 = 2. * scaleFactor; break; case SOUTH_POLE: case NORTH_POLE: akm1 = Math.abs(trueScaleLatitude - ProjectionMath.HALFPI) >= EPS10 ? Math.cos(trueScaleLatitude) / Math.tan(ProjectionMath.QUARTERPI - .5 * trueScaleLatitude) : 2. * scaleFactor; break; } } }