/// <summary> /// Initializes the transform using the parameters from the specified coordinate system information /// </summary> /// <param name="projInfo">A ProjectionInfo class contains all the standard and custom parameters needed to initialize this transform</param> protected override void OnInit(ProjectionInfo projInfo) { _phi1 = projInfo.Phi1; if (Math.Abs(_phi1) < EPS10) { throw new ProjectionException(-23); } if (Es > 0) { _en = Proj.Enfn(Es); double c; _m1 = Proj.Mlfn(_phi1, _am1 = Math.Sin(_phi1), c = Math.Cos(_phi1), _en); _am1 = c / (Math.Sqrt(1 - Es * _am1 * _am1) * _am1); } else { if (Math.Abs(_phi1) + EPS10 >= HALF_PI) { _cphi1 = 0; } else { _cphi1 = 1 / Math.Tan(_phi1); } } }
/// <summary> /// Initializes the transform using the parameters from the specified coordinate system information /// </summary> /// <param name="projInfo">A ProjectionInfo class contains all the standard and custom parameters needed to initialize this transform</param> protected override void OnInit(ProjectionInfo projInfo) { if (!IsElliptical) { return; } _en = Proj.Enfn(Es); _m0 = Proj.Mlfn(Phi0, Math.Sin(Phi0), Math.Cos(Phi0), _en); }
/// <summary> /// Initializes the transform using the parameters from the specified coordinate system information /// </summary> /// <param name="projInfo">A ProjectionInfo class contains all the standard and custom parameters needed to initialize this transform</param> protected override void OnInit(ProjectionInfo projInfo) { _en = Proj.Enfn(Es); if (IsElliptical == false) { _n = 1; _m = 0; Setup(); } }
/// <summary> /// Initializes the transform using the parameters from the specified coordinate system information /// </summary> /// <param name="projInfo">A ProjectionInfo class contains all the standard and custom parameters needed to initialize this transform</param> protected override void OnInit(ProjectionInfo projInfo) { if (IsElliptical) { _en = Proj.Enfn(Es); _ml0 = Proj.Mlfn(Phi0, Math.Sin(Phi0), Math.Cos(Phi0), _en); } else { _ml0 = -Phi0; } }
/// <summary> /// Initializes the transform using the parameters from the specified coordinate system information /// </summary> /// <param name="projInfo">A ProjectionInfo class contains all the standard and custom parameters needed to initialize this transform</param> protected override void OnInit(ProjectionInfo projInfo) { Phi0 = projInfo.Phi0; if (Math.Abs(Math.Abs(Phi0) - HALF_PI) < EPS10) { _mode = Phi0 < 0 ? Modes.SouthPole : Modes.NorthPole; _sinph0 = Phi0 < 0 ? -1 : 1; _cosph0 = 0; } else if (Math.Abs(Phi0) < EPS10) { _mode = Modes.Equitorial; _sinph0 = 0; _cosph0 = 1; } else { _mode = Modes.Oblique; _sinph0 = Math.Sin(Phi0); _cosph0 = Math.Cos(Phi0); } if (Es == 0) { return; } _en = Proj.Enfn(Es); if (projInfo.guam.HasValue && projInfo.guam.Value) { _m1 = Proj.Mlfn(Phi0, _sinph0, _cosph0, _en); _isGuam = true; } else { switch (_mode) { case Modes.NorthPole: _mp = Proj.Mlfn(HALF_PI, 1, 0, _en); break; case Modes.SouthPole: _mp = Proj.Mlfn(-HALF_PI, -1, 0, _en); break; case Modes.Equitorial: case Modes.Oblique: _n1 = 1 / Math.Sqrt(1 - Es * _sinph0 * _sinph0); _g = _sinph0 * (_he = E / Math.Sqrt(OneEs)); _he *= _cosph0; break; } } }
/// <summary> /// Initializes the transform using the parameters from the specified coordinate system information /// </summary> /// <param name="projInfo">A ProjectionInfo class contains all the standard and custom parameters needed to initialize this transform</param> protected override void OnInit(ProjectionInfo projInfo) { double sinphi; if (projInfo.StandardParallel1 != null) { _phi1 = projInfo.StandardParallel1.Value * Math.PI / 180; } if (projInfo.StandardParallel2 != null) { _phi2 = projInfo.StandardParallel2.Value * Math.PI / 180; } if (Math.Abs(_phi1 + _phi2) < EPS10) { throw new ProjectionException(-21); } _en = Proj.Enfn(Es); _n = sinphi = Math.Sin(_phi1); double cosphi = Math.Cos(_phi1); bool secant = Math.Abs(_phi1 - _phi2) >= EPS10; if (IsElliptical) { double m1 = Proj.Msfn(sinphi, cosphi, Es); double ml1 = Proj.Mlfn(_phi1, sinphi, cosphi, _en); if (secant) { /* secant cone */ sinphi = Math.Sin(_phi2); cosphi = Math.Cos(_phi2); _n = (m1 - Proj.Msfn(sinphi, cosphi, Es)) / (Proj.Mlfn(_phi2, sinphi, cosphi, _en) - ml1); } _c = ml1 + m1 / _n; _rho0 = _c - Proj.Mlfn(Phi0, Math.Sin(Phi0), Math.Cos(Phi0), _en); } else { if (secant) { _n = (cosphi - Math.Cos(_phi2)) / (_phi2 - _phi1); } _c = _phi1 + Math.Cos(_phi1) / _n; _rho0 = _c - Phi0; } }