/// <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)); }