4
this.sin_p12=Math.sin(this.lat0)
5
this.cos_p12=Math.cos(this.lat0)
13
var sinphi=Math.sin(p.y);
14
var cosphi=Math.cos(p.y);
15
var dlon = Proj4js.common.adjust_lon(lon - this.long0);
16
var coslon = Math.cos(dlon);
17
var g = this.sin_p12 * sinphi + this.cos_p12 * cosphi * coslon;
18
if (Math.abs(Math.abs(g) - 1.0) < Proj4js.common.EPSLN) {
21
Proj4js.reportError("aeqd:Fwd:PointError");
28
p.x = this.x0 + this.a * ksp * cosphi * Math.sin(dlon);
29
p.y = this.y0 + this.a * ksp * (this.cos_p12 * sinphi - this.sin_p12 * cosphi * coslon);
37
var rh = Math.sqrt(p.x * p.x + p.y *p.y);
38
if (rh > (2.0 * Proj4js.common.HALF_PI * this.a)) {
39
Proj4js.reportError("aeqdInvDataError");
49
if (Math.abs(rh) <= Proj4js.common.EPSLN) {
52
lat = Proj4js.common.asinz(cosz * this.sin_p12 + (p.y * sinz * this.cos_p12) / rh);
53
var con = Math.abs(this.lat0) - Proj4js.common.HALF_PI;
54
if (Math.abs(con) <= Proj4js.common.EPSLN) {
56
lon = Proj4js.common.adjust_lon(this.long0 + Math.atan2(p.x , -p.y));
58
lon = Proj4js.common.adjust_lon(this.long0 - Math.atan2(-p.x , p.y));
61
con = cosz - this.sin_p12 * Math.sin(lat);
62
if ((Math.abs(con) < Proj4js.common.EPSLN) && (Math.abs(p.x) < Proj4js.common.EPSLN)) {
63
//no-op, just keep the lon value as is
65
var temp = Math.atan2((p.x * sinz * this.cos_p12), (con * rh));
66
lon = Proj4js.common.adjust_lon(this.long0 + Math.atan2((p.x * sinz * this.cos_p12), (con * rh)));