Sun: {
    getGeographicPosition: ((date?: Date, target?: Coordinates) => Coordinates);
    getLocalPosition: ((params: {
        azimuth: number;
        distance?: number;
        point?: Vector3;
        zenith: number;
    }, target?: Vector3) => Vector3);
}

Utility functions related to the position of the sun.

Type declaration

  • getGeographicPosition: ((date?: Date, target?: Coordinates) => Coordinates)
      • (date?, target?): Coordinates
      • Gets the position of the sun in equatorial coordinates at the given date.

        Note: the geographic position of the sun is the location on earth where the sun is at the zenith.

        Parameters

        • Optionaldate: Date

          The date to compute the geographic position. If unspecified, the current date is used.

        • Optionaltarget: Coordinates

        Returns Coordinates

        The geographic position of the sun at the given date.

  • getLocalPosition: ((params: {
        azimuth: number;
        distance?: number;
        point?: Vector3;
        zenith: number;
    }, target?: Vector3) => Vector3)
      • (params, target?): Vector3
      • Returns the local position of the sun, given the zenith and azimuth.

        Parameters

        • params: {
              azimuth: number;
              distance?: number;
              point?: Vector3;
              zenith: number;
          }
          • azimuth: number

            The azimuth of the sun, in degrees, in horizontal coordinates

          • Optionaldistance?: number

            The distance of the sun to the local point.

            1
            
          • Optionalpoint?: Vector3

            The local point.

            (0, 0, 0)
            
          • zenith: number

            The zenith of the sun, in degrees, in horizontal coordinates.

            Note: the value is clamped to the [0°, 90°] range.

        • Optionaltarget: Vector3

        Returns Vector3