Esempio n. 1
0
 /// <summary>
 /// Determines whether the given proportion of the year 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="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><see langword="true"/> if the given proportion of the year 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,
     float proportionOfYear,
     bool equalArea = false)
 {
     var(x, y) = region.GetProjectionFromLocalPosition(
         planet,
         position,
         ranges.GetLength(0),
         ranges.GetLength(1),
         equalArea);
     return(SurfaceMap.GetAnnualRangeIsPositiveAtTime(ranges[x, y], proportionOfYear));
 }
Esempio n. 2
0
 /// <summary>
 /// Determines whether the given <paramref name="moment"/> falls within the range indicated.
 /// </summary>
 /// <param name="planet">The mapped planet.</param>
 /// <param name="range">The range being interpolated.</param>
 /// <param name="moment">The time at which the determination is to be performed.</param>
 /// <returns><see langword="true"/> if the range indicates a positive result for the given
 /// <paramref name="moment"/>; otherwise <see langword="false"/>.</returns>
 public static bool GetAnnualRangeIsPositiveAtTime(
     this Planetoid planet,
     FloatRange range,
     Instant moment) => SurfaceMap.GetAnnualRangeIsPositiveAtTime(range, (float)planet.GetProportionOfYearAtTime(moment));