Example #1
0
 public double LatitudeAtPosition(Tuple3 position, ReferenceFrame referenceFrame)
 {
     if (ReferenceEquals(referenceFrame, null))
     {
         throw new ArgumentNullException(nameof(referenceFrame));
     }
     return(InternalBody.GetLatitude(referenceFrame.PositionToWorldSpace(position.ToVector())));
 }
Example #2
0
        public double AtmosphericDensityAtPosition(Tuple3 Position, ReferenceFrame referenceFrame)
        {
            if (ReferenceEquals(referenceFrame, null))
            {
                throw new ArgumentNullException(nameof(referenceFrame));
            }
            var adjustedPosition = referenceFrame.PositionToWorldSpace(Position.ToVector());
            var altitude         = InternalBody.GetAltitude(adjustedPosition);
            var latitude         = InternalBody.GetLatitude(adjustedPosition);
            var pressure         = FlightGlobals.getStaticPressure(adjustedPosition);
            var temperature      = FlightGlobals.getExternalTemperature(altitude, InternalBody)
                                   + InternalBody.atmosphereTemperatureSunMultCurve.Evaluate((float)altitude)
                                   * (InternalBody.latitudeTemperatureBiasCurve.Evaluate((float)latitude)
                                      + InternalBody.latitudeTemperatureSunMultCurve.Evaluate((float)latitude) // fix that 0 into latitude
                                      + InternalBody.axialTemperatureSunMultCurve.Evaluate(1));

            return(FlightGlobals.getAtmDensity(pressure, temperature));
        }