private Point3d SatToPoint(SmSatellite sat) { double scale = SpaceMonkeyCoreViewModel.Instance.ScaleFactor; Point3d basePt = new Point3d(0, 0, 0); Transform transform = Transform.Translation(new Vector3d(-6378.137 * scale, 0, 0)); // Radius of Earth in km at sea level basePt.Transform(transform); // Move point from origin to prime meridian Point3d satPt = new Point3d(basePt.X, basePt.Y, basePt.Z); Transform altitudeTranslation = Transform.Translation(new Vector3d(-(sat.SatAlt * scale), 0, 0)); satPt.Transform(altitudeTranslation); Point3d newVectDir = new Point3d(satPt.X, satPt.Y, satPt.Z); double horizRadians = (Math.PI / 180) * sat.SatLng; double horizAxisRadians = (Math.PI / 180) * (sat.SatLng - 90); double vertRadians = (Math.PI / 180) * sat.SatLat; Transform horizRotation = Transform.Rotation(horizRadians, Vector3d.ZAxis, new Point3d(0, 0, 0)); satPt.Transform(horizRotation); Transform horizAxisRotation = Transform.Rotation(horizAxisRadians, Vector3d.ZAxis, new Point3d(0, 0, 0)); newVectDir.Transform(horizAxisRotation); Transform vertRotation = Transform.Rotation(vertRadians, new Vector3d(newVectDir), new Point3d(0, 0, 0)); satPt.Transform(vertRotation); return(satPt); }
public SatelliteCardViewModel(SmSatellite sat) { this.Initialize(sat.SatId, sat.SatName, sat.IntDesignator, sat.LaunchDate, sat.SatLat, sat.SatLng, sat.SatAlt); }