public static OrientationParameter CalculateLocalAstronomicLocalGeodeticParameter(IGeodeticPoint initialPoint, AngularUnit astronomicalLatitude, AngularUnit astronomicalLongitude) { double tempLatSin = initialPoint.Latitude.Sin; double tempLatCos = initialPoint.Latitude.Cos; double tempLongSin = initialPoint.Longitude.Sin; double tempLongCos = initialPoint.Longitude.Cos; double tempEx = initialPoint.Datum.DatumMisalignment.Omega.ChangeTo <Radian>().Value; double tempEy = initialPoint.Datum.DatumMisalignment.Phi.ChangeTo <Radian>().Value; double tempEz = initialPoint.Datum.DatumMisalignment.Kappa.ChangeTo <Radian>().Value; double tempDeltaLambda = astronomicalLongitude.Subtract(initialPoint.Longitude).ChangeTo <Radian>().Value; double tempDeltaPhi = astronomicalLatitude.Subtract(initialPoint.Latitude).ChangeTo <Radian>().Value; double tempDeltaAzimuth = tempDeltaLambda * tempLatSin - tempLatCos * (tempEx * tempLongCos + tempEy * tempLongSin) - tempEz * tempLatSin; double tempKesi = tempDeltaPhi - tempEx * tempLongSin - tempEy * tempLongCos; double tempEta = tempDeltaLambda * tempLongCos + tempLatSin * (tempEx * tempLongCos + tempEy * tempLongSin) - tempEz * tempLatCos; return(new OrientationParameter(new Radian(tempEta), new Radian(tempKesi), new Radian(tempDeltaAzimuth))); }
public static Astronomical <T> HorizontalAngleToLocalAstronomic <T>(IAstronomical horizontalAngle, AngularUnit astronomicalLatitude) where T : AngularUnit, new() { ICartesian3D tempCoordinate = horizontalAngle.ToCartesian <Meter>(); Matrix rZ = CalculateRotationMatrixAroundZ(new Radian(Math.PI)); Matrix rY = CalculateRotationMatrixAroundY(astronomicalLatitude.Subtract(new Radian(Math.PI)).Negate()); return(tempCoordinate.Rotate(rZ * rY).ToAstronomicForm <T>(horizontalAngle.HorizontalAngleRange)); }
public static Astronomical <T> LocalAstronomicToHorizontalAngle <T>(IAstronomical localAstronomic, AngularUnit astronomicalLatitude) where T : AngularUnit, new() { ICartesian3D tempCoordinate = localAstronomic.ToCartesian <Meter>(); Matrix rZ = CalculateRotationMatrixAroundZ(new Radian(Math.PI)); Matrix rY = CalculateRotationMatrixAroundY(astronomicalLatitude.Subtract(new Radian(Math.PI))); return(tempCoordinate.Rotate(rY * rZ).ToAstronomicForm <T>(localAstronomic.HorizontalAngleRange)); }
public static Cartesian3D <T> LocalGeodeticToLocalAstronomic <T>(ICartesian3D localGeodetic, AngularUnit initialAstronomicAzimuth, AngularUnit initialGeodeticAzimuth, AngularUnit kessi, AngularUnit eta) where T : LinearUnit, new() { Matrix rZ = CalculateRotationMatrixAroundZ((initialAstronomicAzimuth.Subtract(initialGeodeticAzimuth)).Negate()); Matrix rY = CalculateRotationMatrixAroundY(kessi); Matrix rX = CalculateRotationMatrixAroundX(eta.Negate()); return(localGeodetic.Rotate((rX * rY * rZ)).ChangeTo <T>()); }
public static Cartesian3D <T> AverageToLocalAstronomic <T>(ICartesian3D averageTerrestrial, IGeodeticPoint initialPoint, AngularUnit astronomicalLongitude, AngularUnit astronomicalLatitude) where T : LinearUnit, new() { //average Terrestrial is right handed // Error.NO.1: initialPoint.ToCartesian<T> is not correct we need the coordinate in CT System ICartesian3D tempCoordinate = averageTerrestrial.Shift(Transformation.GeodeticToAverage <T>(initialPoint)); Matrix rZ = CalculateRotationMatrixAroundZ(astronomicalLongitude.Subtract(new Radian(Math.PI))); Matrix rY = CalculateRotationMatrixAroundY(astronomicalLatitude.Subtract(new Radian(Math.PI / 2))); Matrix p2 = CalculateReflectionMatrix(); //LA is Left Handed return(tempCoordinate.Transform(p2 * rY * rZ, AxisType.LeftHanded).ChangeTo <T>()); }