Ejemplo n.º 1
0
 /// <summary>
 /// Determines whether the given <paramref name="moment"/> falls within the range indicated
 /// for a <paramref name="position"/> in a <paramref name="region"/>.
 /// </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 determination 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><see langword="true"/> if the given <paramref name="moment"/> falls within the
 /// range indicated for a <paramref name="position"/> in a <paramref name="region"/>;
 /// otherwise <see langword="false"/>.</returns>
 public static bool GetAnnualRangeIsPositiveAtTimeAndLocalPosition(
     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.GetAnnualRangeIsPositiveAtTime(ranges[x, y], moment));
 }
Ejemplo n.º 2
0
 /// <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));
 }