Example #1
0
        public GPLocation getLocation(double jdate)
        {
            if (jdate < julianStart)
            {
                return(temp);
            }
            if (jdate > julianEnd)
            {
                return(temp);
            }

            double lonA, lonB;
            double latA, latB;

            lonA = LocationA.GetLongitudeEastPositive();
            lonB = LocationB.GetLongitudeEastPositive();
            latA = LocationA.GetLatitudeNorthPositive();
            latB = LocationB.GetLatitudeNorthPositive();

            temp.setTimeZone(TimezoneStart ? LocationA.getTimeZone() : LocationB.getTimeZone());
            temp.setLongitudeEastPositive(lonA + (lonB - lonA) * (jdate - julianStart) / (julianEnd - julianStart));
            temp.setLatitudeNorthPositive(latA + (latB - latA) * (jdate - julianStart) / (julianEnd - julianStart));
            //Debugger.Log(0, "", String.Format("== longitude/latitude {0} {1}\n", temp.getLongitudeString(), temp.getLatitudeString()));
            temp.SetAltitude(0);

            return(temp);
        }
Example #2
0
        public GPLocation getTravellingLocation(double ratio)
        {
            double lonA, lonB;
            double latA, latB;

            lonA = LocationA.GetLongitudeEastPositive();
            lonB = LocationB.GetLongitudeEastPositive();
            latA = LocationA.GetLatitudeNorthPositive();
            latB = LocationB.GetLatitudeNorthPositive();

            GPLocation newLoc = new GPLocation();

            newLoc.setTimeZone(TimezoneStart ? LocationA.getTimeZone() : LocationB.getTimeZone());
            newLoc.setLongitudeEastPositive(lonA + (lonB - lonA) * ratio);
            newLoc.setLatitudeNorthPositive(latA + (latB - latA) * ratio);
            newLoc.SetAltitude(0);

            return(newLoc);
        }