예제 #1
0
 /// <summary>
 /// Distance to another.
 /// </summary>
 public double Distance(C3DPoint Other)
 {
     double dx = x - Other.x;
     double dy = y - Other.y;
     double dz = z - Other.z;
     return Math.Sqrt(  dx*dx + dy * dy + dz * dz);
 }
예제 #2
0
        /// <summary>
        /// Distance to another.
        /// </summary>
        public double Distance(C3DPoint Other)
        {
            double dx = x - Other.x;
            double dy = y - Other.y;
            double dz = z - Other.z;

            return(Math.Sqrt(dx * dx + dy * dy + dz * dz));
        }
예제 #3
0
파일: Geodetic.cs 프로젝트: kasznare/DIP1
        /// <summary>
        /// Slant Range.
        /// </summary>
        public double SlantRange(CGeoLatLong Other)
        {
            C3DPoint ptThis = new C3DPoint();

            Geocentric(ptThis);

            C3DPoint ptOther = new C3DPoint();

            Other.Geocentric(ptOther);

            return(ptThis.Distance(ptOther));
        }
예제 #4
0
파일: Geodetic.cs 프로젝트: kasznare/DIP1
        /// <summary>
        /// Conversion to geocentric.
        /// </summary>
        public void Geocentric(C3DPoint xyzPoint)
        {
            if (!IsValid())
            {
                return;
            }

            double Sin_Lat = Math.Sin(m_dLat);      //  Math.Sin(Latitude)
            double Cos_Lat = Math.Cos(m_dLat);      //  Math.Cos(Latitude)

            xyzPoint.x = (Constants.conEARTH_RADIUS_METRES) * Cos_Lat * Math.Cos(m_dLong);

            xyzPoint.y = (Constants.conEARTH_RADIUS_METRES) * Cos_Lat * Math.Sin(m_dLong);

            xyzPoint.z = (Constants.conEARTH_RADIUS_METRES) * Sin_Lat;

            return;
        }
예제 #5
0
파일: Geodetic.cs 프로젝트: kasznare/DIP1
        /// <summary>
        /// Conversion to geocentric.
        /// </summary>
        public void GeocentricWSG84(C3DPoint xyzPoint)
        {
            if (!IsValid())
            {
                return;
            }

            double Sin_Lat  = Math.Sin(m_dLat);                                                                     //  Math.Sin(Latitude)
            double Cos_Lat  = Math.Cos(m_dLat);                                                                     //  Math.Cos(Latitude)
            double Sin2_Lat = Sin_Lat * Sin_Lat;                                                                    // Square of Math.Sin(Latitude)
            double Rn       = Constants.conGeocent_Major / (Math.Sqrt(1.0e0 - Constants.conGeocent_e2 * Sin2_Lat)); //  Earth radius at location

            xyzPoint.x = Rn * Cos_Lat * Math.Cos(m_dLong);

            xyzPoint.y = Rn * Cos_Lat * Math.Sin(m_dLong);

            xyzPoint.z = (Rn * (1 - Constants.conGeocent_e2)) * Sin_Lat;

            return;
        }
예제 #6
0
        /// <summary>
        /// Slant Range.
        /// </summary>
        public double SlantRangeWSG84(CGeoLatLong Other)
        {
            C3DPoint ptThis = new C3DPoint();

            GeocentricWSG84(ptThis);

            C3DPoint ptOther = new C3DPoint();

            Other.GeocentricWSG84(ptOther);

            return ptThis.Distance(ptOther);
        }
예제 #7
0
        /// <summary>
        /// Conversion to geocentric.
        /// </summary>
        public void GeocentricWSG84(C3DPoint xyzPoint)
        {
            if(!IsValid())
                return;

            double Sin_Lat = Math.Sin(m_dLat);  //  Math.Sin(Latitude)
            double Cos_Lat = Math.Cos(m_dLat);  //  Math.Cos(Latitude)
            double Sin2_Lat = Sin_Lat * Sin_Lat; // Square of Math.Sin(Latitude)
            double Rn = Constants.conGeocent_Major / (Math.Sqrt(1.0e0 - Constants.conGeocent_e2 * Sin2_Lat)); //  Earth radius at location

            xyzPoint.x = Rn * Cos_Lat * Math.Cos(m_dLong);

            xyzPoint.y = Rn * Cos_Lat * Math.Sin(m_dLong);

            xyzPoint.z = (Rn * (1 - Constants.conGeocent_e2)) * Sin_Lat;

            return;
        }
예제 #8
0
        /// <summary>
        /// Conversion to geocentric.
        /// </summary>
        public void Geocentric(C3DPoint xyzPoint)
        {
            if(!IsValid())
                return;

            double Sin_Lat = Math.Sin(m_dLat);  //  Math.Sin(Latitude)
            double Cos_Lat = Math.Cos(m_dLat);  //  Math.Cos(Latitude)

            xyzPoint.x = (Constants.conEARTH_RADIUS_METRES) * Cos_Lat * Math.Cos(m_dLong);

            xyzPoint.y = (Constants.conEARTH_RADIUS_METRES) * Cos_Lat * Math.Sin(m_dLong);

            xyzPoint.z = (Constants.conEARTH_RADIUS_METRES) * Sin_Lat;

            return;
        }