Package-level declarations

Types

Link copied to clipboard
sealed interface LightPhase

A state the sun can be in where the angle can cause lighting effects. This is mostly relevant to photographers.

Link copied to clipboard
sealed interface LightPhaseInfo

Describes what a LightPhase is by defining the range of angles for which a particular LightPhase is active for.

Link copied to clipboard
sealed interface LightState : LightPhase

A state the sun can be in where the angle can cause lighting effects. This is mostly relevant to photographers.

Link copied to clipboard
sealed interface SolarEvent : Comparable<SolarEvent>

Times when particular solar events of interest happen. Examples would be things like Sunrise, sunset, solar noon, start of civil dawn, etc. These events represent moments or Instants in time. This time can be extracted via SolarEvent.time

Link copied to clipboard
class SolarEventSequence(start: Instant, latitude: Double, longitude: Double, limit: Duration = 365.days, requestedSolarEvents: List<SolarEventType> = SolarEventType.simple, reverse: Boolean = false) : Sequence<SolarEvent>

Sequence representing all SolarEvents supported by Kastro. The sequence will be ordered by SolarEvent.time either advancing forwards or backwards in time depending on the reverse parameter.

Link copied to clipboard
sealed interface SolarEventType

Types of SolarEvents that can be requested in a SolarEventSequence

Link copied to clipboard
sealed interface SolarPhase

Represents the "state" of the sun. SolarEvents represent moments in time where state transitions may occur. SolarPhase, in contrast, represents the ranges between SolarEvents. For a given location there is always a SolarPhase to describe the sun at any given kotlinx.datetime.Instant

Link copied to clipboard

Single class containing all the information Kastro can calculate about Sol for a given instant of time. Contains the result of multiple calculations.

Link copied to clipboard
sealed interface Twilight

Twilights are states of the sun defined by the number of degrees below the horizon. Each Twilight has a TwilightInfo.angleRange that defines the range of angles for which the sun would be considered to be in that associated Twilight.

Link copied to clipboard
sealed interface TwilightInfo

Describes what a Twilight is by defining the range of angles for which a particular Twilight is active for.

Properties

Link copied to clipboard

Range of angles for which a given LightPhaseInfo is active for.

Range of angles for which a given TwilightInfo is active for.

Functions

Link copied to clipboard
fun Instant.calculateSolarState(location: Pair<Double, Double>, height: Double = 0.0): SolarState
fun Instant.calculateSolarState(latitude: Double, longitude: Double, height: Double = 0.0): SolarState

Calculates the SolarState for a given Instant in time