/// <summary> /// Gets the value for a <paramref name="position"/> in a <paramref name="region"/> at a /// given <paramref name="moment"/> from a set of ranges. /// </summary> /// <param name="region">The mapped region.</param> /// <param name="planet">The mapped planet.</param> /// <param name="position">A position relative to the center of <paramref /// name="region"/>.</param> /// <param name="ranges">A set of ranges.</param> /// <param name="moment">The time at which the calculation is to be performed.</param> /// <param name="equalArea"> /// If <see langword="true"/> the projection will be a cylindrical equal-area projection. /// Otherwise, an equirectangular projection will be used. /// </param> /// <returns>The value for a <paramref name="position"/> in a <paramref name="region"/> at a /// given <paramref name="moment"/> from a set of ranges.</returns> public static float GetAnnualValueFromLocalPosition( this SurfaceRegion region, Planetoid planet, Vector3 position, FloatRange[,] ranges, Instant moment, bool equalArea = false) { var(x, y) = region.GetProjectionFromLocalPosition( planet, position, ranges.GetLength(0), ranges.GetLength(1), equalArea); return(planet.GetAnnualRangeValue( ranges[x, y], moment)); }