KHolidays

sunriseset.h
1/*
2 This file is part of the kholidays library.
3
4 SPDX-FileCopyrightText: 2012 Allen Winter <winter@kde.org>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7*/
8
9#ifndef KHOLIDAYS_SUNRISESET_H
10#define KHOLIDAYS_SUNRISESET_H
11
12#include "kholidays_export.h"
13#include <QTime>
14
15namespace KHolidays
16{
17/**
18 @brief
19 Methods for determining the sunrise and sunset times for a given date and Earth location.
20*/
21
22namespace SunRiseSet
23{
24/**
25 Compute the sunrise time (UTC) for a date and Earth location.
26 @param date is any valid QDate.
27 @param latitude is a floating point representing a valid latitude (-90.0, 90.0)
28 @param longitude is a floating point representing a valid longitude (-180.0, 180.0)
29 @return the QTime of the sunrise in UTC.
30
31 @note the latitude and longitude are truncated as needed to fit into their proper range.
32
33*/
34KHOLIDAYS_EXPORT QTime utcSunrise(const QDate &date, double latitude, double longitude);
35
36/**
37 Compute the sunset time (UTC) for a date and Earth location.
38 @param date is any valid QDate.
39 @param latitude is a floating point representing a valid latitude (-90.0, 90.0)
40 @param longitude is a floating point representing a valid longitude (-180.0, 180.0)
41 @return the QTime of the sunset in UTC.
42
43 @note the latitude and longitude are truncated as needed to fit into their proper range.
44*/
45KHOLIDAYS_EXPORT QTime utcSunset(const QDate &date, double latitude, double longitude);
46
47/**
48 Compute the civil dawn time (UTC) for a date and Earth location.
49 @param date is any valid QDate.
50 @param latitude is a floating point representing a valid latitude (-90.0, 90.0)
51 @param longitude is a floating point representing a valid longitude (-180.0, 180.0)
52 @see https://en.wikipedia.org/wiki/Twilight
53 @return the QTime of the sunrise in UTC.
54
55 @note the latitude and longitude are truncated as needed to fit into their proper range.
56 @since 5.77
57*/
58KHOLIDAYS_EXPORT QTime utcDawn(const QDate &date, double latitude, double longitude);
59
60/**
61 Compute the civil dawn time (UTC) for a date and Earth location.
62 @param date is any valid QDate.
63 @param latitude is a floating point representing a valid latitude (-90.0, 90.0)
64 @param longitude is a floating point representing a valid longitude (-180.0, 180.0)
65 @see https://en.wikipedia.org/wiki/Twilight
66 @return the QTime of the sunset in UTC.
67
68 @note the latitude and longitude are truncated as needed to fit into their proper range.
69 @since 5.77
70*/
71KHOLIDAYS_EXPORT QTime utcDusk(const QDate &date, double latitude, double longitude);
72
73/**
74 Checks whether it is polar day on day @p date at @p latitude.
75 That is, the sun stays above -0.83° relative to the horizon at all times.
76 Both sunrise/sunset and dawn/dusk times will be invalid for such a day.
77 @param latitude in degree (-90.0, 90.0)
78 @see isPolarNight(), isPolarTwilight()
79 @see https://en.wikipedia.org/wiki/Midnight_sun
80
81 @since 5.97
82*/
83KHOLIDAYS_EXPORT bool isPolarDay(const QDate &date, double latitude);
84
85/**
86 Checks whether it is polar twilight on day @p date at @p latitude.
87 That is, the sun rises at least above -6° relative the horizon during the day,
88 but remains below -0.83° at all times. Sunrise/sunset times will be invalid
89 for such a day, but dawn/dusk times will be available.
90 @param latitude in degree (-90.0, 90.0)
91 @see isPolarDay(), isPolarNight()
92 @see https://en.wikipedia.org/wiki/Polar_night
93
94 @since 5.97
95*/
96KHOLIDAYS_EXPORT bool isPolarTwilight(const QDate &date, double latitude);
97
98/**
99 Checks whether it is polar night on day @p date at @p latitude.
100 That is, the sun stays below -6° relative to the horizon at all times.
101 Both sunrise/sunset and dawn/dusk times will be invalid for such a day.
102 @param latitude in degree (-90.0, 90.0)
103 @see isPolarDay(), isPolarTwilight()
104 @see https://en.wikipedia.org/wiki/Polar_night
105
106 @since 5.97
107*/
108KHOLIDAYS_EXPORT bool isPolarNight(const QDate &date, double latitude);
109}
110
111}
112
113#endif
KHOLIDAYS_EXPORT bool isPolarTwilight(const QDate &date, double latitude)
Checks whether it is polar twilight on day date at latitude.
KHOLIDAYS_EXPORT QTime utcSunset(const QDate &date, double latitude, double longitude)
Compute the sunset time (UTC) for a date and Earth location.
KHOLIDAYS_EXPORT QTime utcSunrise(const QDate &date, double latitude, double longitude)
Compute the sunrise time (UTC) for a date and Earth location.
KHOLIDAYS_EXPORT bool isPolarDay(const QDate &date, double latitude)
Checks whether it is polar day on day date at latitude.
KHOLIDAYS_EXPORT bool isPolarNight(const QDate &date, double latitude)
Checks whether it is polar night on day date at latitude.
KHOLIDAYS_EXPORT QTime utcDawn(const QDate &date, double latitude, double longitude)
Compute the civil dawn time (UTC) for a date and Earth location.
KHOLIDAYS_EXPORT QTime utcDusk(const QDate &date, double latitude, double longitude)
Compute the civil dawn time (UTC) for a date and Earth location.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:07:10 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.