/// <summary> /// Gets the elevation at the given <paramref name="position"/>, in meters. /// </summary> /// <param name="planet">The mapped planet.</param> /// <param name="elevationMap">An elevation map.</param> /// <param name="position">The position at which to determine elevation.</param> /// <param name="options">The map projection used.</param> /// <returns> /// The elevation at the given <paramref name="position"/>, in meters. /// </returns> public static double GetElevationAt( this Planetoid planet, Image <L16> elevationMap, Vector3 position, MapProjectionOptions?options = null) => planet.GetElevationAt( elevationMap, planet.VectorToLatitude(position), planet.VectorToLongitude(position), options);
/// <summary> /// Calculates the atmospheric pressure at a given <paramref name="latitude"/> and <paramref /// name="longitude"/>, at the given true anomaly of the planet's orbit, in kPa. /// </summary> /// <param name="planet">The mapped planet.</param> /// <param name="elevationMap">An elevation map.</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 at which to determine atmospheric pressure.</param> /// <param name="longitude">The longitude at which to determine atmospheric /// pressure.</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 pressure at the specified height, in kPa.</returns> /// <remarks> /// In an Earth-like atmosphere, the pressure lapse rate varies considerably in the /// different atmospheric layers, but this cannot be easily modeled for arbitrary /// exoplanetary atmospheres, so the simple barometric formula is used, which should be /// "close enough" for the purposes of this library. Also, this calculation uses the molar /// mass of air on Earth, which is clearly not correct for other atmospheres, but is /// considered "close enough" for the purposes of this library. /// </remarks> public static double GetAtmosphericPressure( this Planetoid planet, Image <L16> elevationMap, Image <L16> winterTemperatures, Image <L16> summerTemperatures, double proportionOfYear, double latitude, double longitude, bool surface = true, MapProjectionOptions?options = null) { var elevation = planet.GetElevationAt(elevationMap, latitude, longitude, options); var surfaceTemp = SurfaceMapImage.GetSurfaceTemperature(winterTemperatures, summerTemperatures, proportionOfYear, latitude, longitude, options); var tempAtElevation = planet.GetTemperatureAtElevation(surfaceTemp, elevation, surface); return(planet.Atmosphere.GetAtmosphericPressure(planet, tempAtElevation, elevation)); }