/// <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) { const double phi_0 = 0.0; _rok = A / K0; _rtk = A * K0; if (projInfo.Parameters.ContainsKey("alpha")) { double alpha = projInfo.ParamR("alpha"); double lonz = projInfo.ParamR("lonc"); _singam = Math.Atan(-Math.Cos(alpha) / (-Math.Sin(phi_0) * Math.Sin(alpha))) + lonz; _sinphi = Math.Asin(Math.Cos(phi_0) * Math.Sin(alpha)); } else { double phi_1 = projInfo.GetPhi1(); double phi_2 = projInfo.GetPhi2(); double lam_1 = projInfo.ParamR("lon_1"); double lam_2 = projInfo.ParamR("lon_2"); _singam = Math.Atan2(Math.Cos(phi_1) * Math.Sin(phi_2) * Math.Cos(lam_1) - Math.Sin(phi_1) * Math.Cos(phi_2) * Math.Cos(lam_2), Math.Sin(phi_1) * Math.Cos(phi_2) * Math.Sin(lam_2) - Math.Cos(phi_1) * Math.Sin(phi_2) * Math.Sin(lam_1)); _sinphi = Math.Atan(-Math.Cos(_singam - lam_1) / Math.Tan(phi_1)); } Lam0 = _singam + HalfPi; _cosphi = Math.Cos(_sinphi); _sinphi = Math.Sin(_sinphi); _singam = Math.Sin(_singam); }