/// <summary> /// Calculates the atmospheric density for the given conditions, in kg/m³. /// </summary> /// <param name="planet">The mapped planet.</param> /// <param name="winterTemperatures">A winter temperature map.</param> /// <param name="summerTemperatures">A summer temperature map.</param> /// <param name="proportionOfYear"> /// The proportion of a full year at which the map is to be generated, assuming a year /// begins and ends at the winter solstice in the northern hemisphere. /// </param> /// <param name="latitude">The latitude of the object.</param> /// <param name="longitude">The longitude of the object.</param> /// <param name="altitude">The altitude of the object.</param> /// <param name="surface"> /// If <see langword="true"/> the determination is made for a location /// on the surface of the planetoid at the given elevation. Otherwise, the calculation is /// made for an elevation above the surface. /// </param> /// <param name="options">The map projection used.</param> /// <returns>The atmospheric density for the given conditions, in kg/m³.</returns> public static double GetAtmosphericDensity( this Planetoid planet, Image <L16> winterTemperatures, Image <L16> summerTemperatures, double proportionOfYear, double latitude, double longitude, double altitude, bool surface = true, MapProjectionOptions?options = null) { var surfaceTemp = SurfaceMapImage.GetSurfaceTemperature(winterTemperatures, summerTemperatures, proportionOfYear, latitude, longitude, options); var tempAtElevation = planet.GetTemperatureAtElevation(surfaceTemp, altitude, surface); return(planet.Atmosphere.GetAtmosphericDensity(planet, tempAtElevation, altitude)); }