/// <summary> /// Gets the value for a <paramref name="position"/> in a <paramref name="region"/> at a /// given proportion of the year 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="proportionOfYear"> /// The proportion of the year, starting and ending with midwinter, 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 proportion of the year from a set of ranges.</returns> public static float GetAnnualValueFromLocalPosition( this SurfaceRegion region, Planetoid planet, Vector3 position, FloatRange[,] ranges, float proportionOfYear, bool equalArea = false) { var(x, y) = region.GetProjectionFromLocalPosition( planet, position, ranges.GetLength(0), ranges.GetLength(1), equalArea); return(SurfaceMap.GetAnnualRangeValue( ranges[x, y], proportionOfYear)); }
/// <summary> /// Gets a specific value from a range which varies over the course of a year. /// </summary> /// <param name="planet">The mapped planet.</param> /// <param name="range">The range being interpolated.</param> /// <param name="moment">The time at which the calculation is to be performed.</param> /// <returns>The specific value from a range which varies over the course of a /// year.</returns> public static float GetAnnualRangeValue( this Planetoid planet, FloatRange range, Instant moment) => SurfaceMap.GetAnnualRangeValue(range, (float)planet.GetProportionOfYearAtTime(moment));