コード例 #1
0
 public ReferencePoint(Vector3 xyz, PointGeo wgs, float angle,
                       float altitudeFactor = 1.0f, float longitudeFactor = 0.9875f, float latitudeFactor = 0.9875f)
 {
     this.XyzPoint        = xyz;
     this.WgsPoint        = wgs;
     this.Angle           = angle;
     this.AltitudeFactor  = altitudeFactor;
     this.LongitudeFactor = longitudeFactor;
     this.LatitudeFactor  = latitudeFactor;
 }
コード例 #2
0
 public void AverageWith(PointGeo otherPoint, float coeffSelf, float coeffOther)
 {
     Latitude  = (coeffSelf * Latitude + coeffOther * otherPoint.Latitude) / (coeffSelf + coeffOther);
     Longitude = (coeffSelf * Longitude + coeffOther * otherPoint.Longitude) / (coeffSelf + coeffOther);
     Elevation = (coeffSelf * Elevation + coeffOther * otherPoint.Elevation) / (coeffSelf + coeffOther);
 }
コード例 #3
0
        private static PointGeo SXYZWGS(float x, float y, float z, Vector3 trackOriginXYZ, PointGeo trackOriginWGS, float altitudeFactor, float longitudeFactor, float latitudeFactor)
        {
            var x0 = trackOriginXYZ.X;
            var y0 = trackOriginXYZ.Y;
            var z0 = trackOriginXYZ.Z;

            var lon0 = trackOriginWGS.Longitude;
            var lat0 = trackOriginWGS.Latitude;
            var ele0 = trackOriginWGS.Elevation;


            var mPerDegree = 2 * Math.PI * R / 360.0f;


            var latitude  = lat0 - (y - y0) / (latitudeFactor * mPerDegree);
            var longitude = lon0 + (x - x0) / (longitudeFactor * mPerDegree * (float)Math.Cos(DegToRad((float)latitude)));

            var deltaElevation = (z - z0) * altitudeFactor;
            var elevation      = ele0 + deltaElevation;

            return(new PointGeo((float)latitude, (float)longitude, elevation));
        }