001/*
002 * Zmanim Java API
003 * Copyright (C) 2004-2025 Eliyahu Hershfeld
004 *
005 * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
006 * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
007 * any later version.
008 *
009 * This library is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied
010 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
011 * details.
012 * You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to
013 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA,
014 * or connect to: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
015 */
016package com.kosherjava.zmanim;
017
018import java.util.Calendar;
019import java.util.Date;
020import com.kosherjava.zmanim.util.AstronomicalCalculator;
021import com.kosherjava.zmanim.util.GeoLocation;
022import com.kosherjava.zmanim.hebrewcalendar.JewishCalendar;
023
024/**
025 * <p>This class extends ZmanimCalendar and provides many more <em>zmanim</em> than available in the ZmanimCalendar. The basis
026 * for most <em>zmanim</em> in this class are from the <em>sefer</em> <b><a href="https://hebrewbooks.org/9765">Yisroel
027 * Vehazmanim</a></b> by <b><a href="https://en.wikipedia.org/wiki/Yisroel_Dovid_Harfenes">Rabbi Yisrael Dovid Harfenes</a></b>.
028 * As an example of the number of different <em>zmanim</em> made available by this class, there are methods to return 18
029 * different calculations for <em>alos</em> (dawn), 18 for <em>plag hamincha</em> and 29 for <em>tzais</em> available in this
030 * API. The real power of this API is the ease in calculating <em>zmanim</em> that are not part of the library. The methods for
031 * <em>zmanim</em> calculations not present in this class or it's superclass  {@link ZmanimCalendar} are contained in the
032 * {@link AstronomicalCalendar}, the base class of the calendars in our API since they are generic methods for calculating
033 * time based on degrees or time before or after {@link #getSunrise() sunrise} and {@link #getSunset() sunset} and are of interest
034 * for calculation beyond <em>zmanim</em> calculations. Here are some examples.
035 * <p>First create the Calendar for the location you would like to calculate:
036 * 
037 * <pre style="background: #FEF0C9; display: inline-block;">
038 * String locationName = &quot;Lakewood, NJ&quot;;
039 * double latitude = 40.0828; // Lakewood, NJ
040 * double longitude = -74.222; // Lakewood, NJ
041 * double elevation = 20; // optional elevation correction in Meters
042 * // the String parameter in getTimeZone() has to be a valid time zone listed in
043 * // {@link java.util.TimeZone#getAvailableIDs()}
044 * TimeZone timeZone = TimeZone.getTimeZone(&quot;America/New_York&quot;);
045 * GeoLocation location = new GeoLocation(locationName, latitude, longitude, elevation, timeZone);
046 * ComplexZmanimCalendar czc = new ComplexZmanimCalendar(location);
047 * // Optionally set the date or it will default to today's date
048 * czc.getCalendar().set(Calendar.MONTH, Calendar.FEBRUARY);
049 * czc.getCalendar().set(Calendar.DAY_OF_MONTH, 8);</pre>
050 * <p>
051 * <b>Note:</b> For locations such as Israel where the beginning and end of daylight savings time can fluctuate from
052 * year to year, if your version of Java does not have an <a href=
053 * "https://www.oracle.com/java/technologies/tzdata-versions.html">up to date time zone database</a>, create a
054 * {@link java.util.SimpleTimeZone} with the known start and end of DST.
055 * To get <em>alos</em> calculated as 14&deg; below the horizon (as calculated in the calendars published in Montreal),
056 * add {@link AstronomicalCalendar#GEOMETRIC_ZENITH} (90) to the 14&deg; offset to get the desired time:
057 * <br><br>
058 * <pre style="background: #FEF0C9; display: inline-block;">
059 *  Date alos14 = czc.getSunriseOffsetByDegrees({@link AstronomicalCalendar#GEOMETRIC_ZENITH} + 14);</pre>
060 * <p>
061 * To get <em>mincha gedola</em> calculated based on the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner"
062 * >Magen Avraham (MGA)</a> using a <em>shaah zmanis</em> based on the day starting
063 * 16.1&deg; below the horizon (and ending 16.1&deg; after sunset) the following calculation can be used:
064 * 
065 * <pre style="background: #FEF0C9; display: inline-block;">
066 * Date minchaGedola = czc.getTimeOffset(czc.getAlos16point1Degrees(), czc.getShaahZmanis16Point1Degrees() * 6.5);</pre>
067 * <p>
068 * or even simpler using the included convenience methods
069 * <pre style="background: #FEF0C9; display: inline-block;">
070 * Date minchaGedola = czc.getMinchaGedola(czc.getAlos16point1Degrees(), czc.getShaahZmanis16Point1Degrees());</pre>
071 * <p>
072 * A little more complex example would be calculating <em>zmanim</em> that rely on a <em>shaah zmanis</em> that is
073 * not present in this library. While a drop more complex, it is still rather easy. An example would be to calculate
074 * the <a href="https://en.wikipedia.org/wiki/Israel_Isserlein">Trumas Hadeshen</a>'s <em>alos</em> to
075 * <em>tzais</em> based <em>plag hamincha</em> as calculated in the Machzikei Hadass calendar in Manchester, England.
076 * A number of this calendar's <em>zmanim</em> are calculated based on a day starting at <em>alos</em> of 12&deg; before
077 * sunrise and ending at <em>tzais</em> of 7.083&deg; after sunset. Be aware that since the <em>alos</em> and <em>tzais</em>
078 * do not use identical degree-based offsets, this leads to <em>chatzos</em> being at a time other than the
079 * {@link #getSunTransit() solar transit} (solar midday). To calculate this <em>zman</em>, use the following steps. Note
080 * that <em>plag hamincha</em> is 10.75 hours after the start of the day, and the following steps are all that it takes.
081 * <br>
082 * <pre style="background: #FEF0C9; display: inline-block;">
083 * Date plag = czc.getPlagHamincha(czc.getSunriseOffsetByDegrees({@link AstronomicalCalendar#GEOMETRIC_ZENITH} + 12),
084 *                              czc.getSunsetOffsetByDegrees({@link AstronomicalCalendar#GEOMETRIC_ZENITH} + ZENITH_7_POINT_083));</pre>
085 * <p>
086 * Something a drop more challenging, but still simple, would be calculating a <em>zman</em> using the same "complex"
087 * offset day used in the above-mentioned Manchester calendar, but for a <em>shaos zmaniyos</em> based <em>zman</em> not
088 * supported by this library, such as calculating the point that one should be <em>makpid</em>
089 * not to eat on <em>erev Shabbos</em> or <em>erev Yom Tov</em>. This is 9 <em>shaos zmaniyos</em> into the day.
090 * <ol>
091 *      <li>Calculate the <em>shaah zmanis</em> in milliseconds for this day</li>
092 *      <li>Add 9 of these <em>shaos zmaniyos</em> to <em>alos</em> starting at 12&deg;</li>
093 * </ol>
094 * <br>
095 * <pre style="background: #FEF0C9; display: inline-block;">
096 * long shaahZmanis = czc.getTemporalHour(czc.getSunriseOffsetByDegrees({@link AstronomicalCalendar#GEOMETRIC_ZENITH} + 12),
097 *                                              czc.getSunsetOffsetByDegrees({@link AstronomicalCalendar#GEOMETRIC_ZENITH} + ZENITH_7_POINT_083));
098 * Date sofZmanAchila = getTimeOffset(czc.getSunriseOffsetByDegrees({@link AstronomicalCalendar#GEOMETRIC_ZENITH} + 12),
099 *                                      shaahZmanis * 9);</pre>
100 * <p>
101 * Calculating this <em>sof zman achila</em> according to the <a href="https://en.wikipedia.org/wiki/Vilna_Gaon">GRA</a>
102 * is simplicity itself.
103 * <pre style="background: #FEF0C9; display: inline-block;">
104 * Date sofZmanAchila = czc.getTimeOffset(czc.getSunrise(), czc.getShaahZmanisGra() * 9);</pre>
105 * 
106 * <h2>See documentation from the {@link ZmanimCalendar} parent class</h2>
107 * 
108 * @author &copy; Eliyahu Hershfeld 2004 - 2025
109 */
110public class ComplexZmanimCalendar extends ZmanimCalendar {
111
112        /**
113         * The zenith of 3.7&deg; below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is used for
114         * calculating <em>tzais</em> (nightfall) based on the opinion of the <em>Geonim</em> that <em>tzais</em> is the
115         * time it takes to walk 3/4 of a <a href="https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement"
116         * >mil</a> at 18 minutes a mil, or 13.5 minutes after sunset. The sun is 3.7&deg; below
117         * {@link #GEOMETRIC_ZENITH geometric zenith} at this time in Jerusalem <a href=
118         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a>.
119         * 
120         * @see #getTzaisGeonim3Point7Degrees()
121         */
122        protected static final double ZENITH_3_POINT_7 = GEOMETRIC_ZENITH + 3.7;
123
124        /**
125         * The zenith of 3.8&deg; below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is used for
126         * calculating <em>tzais</em> (nightfall) based on the opinion of the <em>Geonim</em> that <em>tzais</em> is the
127         * time it takes to walk 3/4 of a <a href="https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement"
128         * >mil</a> at 18 minutes a mil, or 13.5 minutes after sunset. The sun is 3.8&deg; below
129         * {@link #GEOMETRIC_ZENITH geometric zenith} at this time in Jerusalem <a href=
130         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a>.
131         * 
132         * @see #getTzaisGeonim3Point8Degrees()
133         */
134        protected static final double ZENITH_3_POINT_8 = GEOMETRIC_ZENITH + 3.8;
135
136        /**
137         * The zenith of 5.95&deg; below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is used for
138         * calculating <em>tzais</em> (nightfall) according to some opinions. This calculation is based on the position of
139         * the sun 24 minutes after sunset in Jerusalem <a href=
140         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a>,
141         * which calculates to 5.95&deg; below {@link #GEOMETRIC_ZENITH geometric zenith}.
142         * 
143         * @see #getTzaisGeonim5Point95Degrees()
144         */
145        protected static final double ZENITH_5_POINT_95 = GEOMETRIC_ZENITH + 5.95;
146
147        /**
148         * The zenith of 7.083&deg; below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). This is often referred to as
149         * 7&deg;5' or 7&deg; and 5 minutes. This calculation is used for calculating <em>alos</em> (dawn) and
150         * <em>tzais</em> (nightfall) according to some opinions. This calculation is based on observation of 3 medium-sized
151         * stars by Dr. Baruch Cohen in his calendar published in 1899 in Strasbourg, France. This calculates to
152         * 7.0833333&deg; below {@link #GEOMETRIC_ZENITH geometric zenith}. The <a href="https://hebrewbooks.org/1053">Sh"Ut
153         * Melamed Leho'il</a> in Orach Chaim 30 agreed to this <em>zman</em>, as did the Sh"Ut Bnei Tziyon and the Tenuvas Sadeh.
154         * It is very close to the time of the <a href="https://hebrewbooks.org/22044">Mekor Chesed</a> of the Sefer chasidim.
155         * It is close to the position of the sun 30 minutes after sunset in Jerusalem <a href=
156         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a>, but not
157         * Exactly. The actual position of the sun 30 minutes after sunset in Jerusalem at the equilux is 7.205&deg; and
158         * 7.199&deg; at the equinox. See Hazmanim Bahalacha vol 2, pages 520-521 for details.
159         * @todo Hyperlink the proper sources.
160         * 
161         * @see #getTzaisGeonim7Point083Degrees()
162         * @see #getBainHashmashosRT13Point5MinutesBefore7Point083Degrees()
163         */
164        protected static final double ZENITH_7_POINT_083 = GEOMETRIC_ZENITH + 7 + (5.0 / 60);
165
166        /**
167         * The zenith of 10.2&deg; below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is used for
168         * calculating <em>misheyakir</em> according to some opinions. This calculation is based on the position of the sun
169         * 45 minutes before {@link #getSunrise() sunrise} in Jerusalem <a href=
170         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a> which
171         * calculates to 10.2&deg; below {@link #GEOMETRIC_ZENITH geometric zenith}.
172         * 
173         * @see #getMisheyakir10Point2Degrees()
174         */
175        protected static final double ZENITH_10_POINT_2 = GEOMETRIC_ZENITH + 10.2;
176
177        /**
178         * The zenith of 11&deg; below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is used for
179         * calculating <em>misheyakir</em> according to some opinions. This calculation is based on the position of the sun
180         * 48 minutes before {@link #getSunrise() sunrise} in Jerusalem <a href=
181         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a>, which
182         * calculates to 11&deg; below {@link #GEOMETRIC_ZENITH geometric zenith}.
183         * 
184         * @see #getMisheyakir11Degrees()
185         */
186        protected static final double ZENITH_11_DEGREES = GEOMETRIC_ZENITH + 11;
187
188        /**
189         * The zenith of 11.5&deg; below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is used for
190         * calculating <em>misheyakir</em> according to some opinions. This calculation is based on the position of the sun
191         * 52 minutes before {@link #getSunrise() sunrise} in Jerusalem <a href=
192         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a>, which
193         * calculates to 11.5&deg; below {@link #GEOMETRIC_ZENITH geometric zenith}.
194         * 
195         * @see #getMisheyakir11Point5Degrees()
196         */
197        protected static final double ZENITH_11_POINT_5 = GEOMETRIC_ZENITH + 11.5;
198        
199        /**
200         * The zenith of 12.85&deg; below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). This is used for calculating
201         * <em>misheyakir</em> according to some opinions. This calculation is based on the position of the sun slightly less
202         * than 57 minutes before {@link #getSunrise() sunrise} in Jerusalem <a href=
203         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a>, which
204         * calculates to 12.85&deg; below {@link #GEOMETRIC_ZENITH geometric zenith}.
205         * 
206         * @see #getMisheyakir12Point85Degrees()
207         */
208        protected static final double ZENITH_12_POINT_85 = GEOMETRIC_ZENITH + 12.86;
209
210        /**
211         * The zenith of 13.24&deg; below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is used for
212         * calculating Rabbeinu Tam's <em>bain hashmashos</em> according to some opinions.
213         * NOTE: See comments on {@link #getBainHashmashosRT13Point24Degrees} for additional details about the degrees.
214         * 
215         * @see #getBainHashmashosRT13Point24Degrees
216         * 
217         */
218        protected static final double ZENITH_13_POINT_24 = GEOMETRIC_ZENITH + 13.24;
219        
220        /**
221         * The zenith of 19&deg; below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is used for
222         * calculating <em>alos</em> according to some opinions.
223         * 
224         * @see #getAlos19Degrees()
225         * @see #ZENITH_19_POINT_8
226         */
227        protected static final double ZENITH_19_DEGREES = GEOMETRIC_ZENITH + 19;
228
229        /**
230         * The zenith of 19.8&deg; below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is used for
231         * calculating <em>alos</em> (dawn) and <em>tzais</em> (nightfall) according to some opinions. This calculation is
232         * based on the position of the sun 90 minutes after sunset in Jerusalem <a href=
233         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a> which
234         * calculates to 19.8&deg; below {@link #GEOMETRIC_ZENITH geometric zenith}.
235         * 
236         * @see #getTzais19Point8Degrees()
237         * @see #getAlos19Point8Degrees()
238         * @see #getAlos90()
239         * @see #getTzais90()
240         * @see #ZENITH_19_DEGREES
241         */
242        protected static final double ZENITH_19_POINT_8 = GEOMETRIC_ZENITH + 19.8;
243
244        /**
245         * The zenith of 26&deg; below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is used for
246         * calculating <em>alos</em> (dawn) and <em>tzais</em> (nightfall) according to some opinions. This calculation is
247         * based on the position of the sun {@link #getAlos120() 120 minutes} after sunset in Jerusalem <a href=
248         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a> which
249         * calculates to 26&deg; below {@link #GEOMETRIC_ZENITH geometric zenith}. Since the level of darkness when the sun is
250         * 26&deg; and at a point when the level of darkness is long past the 18&deg; point where the darkest point is reached,
251         * it should only be used <em>lechumra</em> such as delaying the start of nighttime <em>mitzvos</em> or avoiding eating
252         * this early on a fast day.
253         * 
254         * @see #getAlos26Degrees()
255         * @see #getTzais26Degrees()
256         * @see #getAlos120()
257         * @see #getTzais120()
258         */
259        protected static final double ZENITH_26_DEGREES = GEOMETRIC_ZENITH + 26.0;
260
261        /**
262         * The zenith of 4.37&deg; below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is used for
263         * calculating <em>tzais</em> (nightfall) according to some opinions. This calculation is based on the position of
264         * the sun {@link #getTzaisGeonim4Point37Degrees() 16 7/8 minutes} after sunset (3/4 of a 22.5-minute <a href=
265         * "https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a>) in Jerusalem <a href=
266         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a>,
267         * which calculates to 4.37&deg; below {@link #GEOMETRIC_ZENITH geometric zenith}.
268         * 
269         * @see #getTzaisGeonim4Point37Degrees()
270         */
271        protected static final double ZENITH_4_POINT_37 = GEOMETRIC_ZENITH + 4.37;
272
273        /**
274         * The zenith of 4.61&deg; below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is used for
275         * calculating <em>tzais</em> (nightfall) according to some opinions. This calculation is based on the position of
276         * the sun {@link #getTzaisGeonim4Point37Degrees() 18 minutes} after sunset (3/4 of a 24-minute <a href=
277         * "https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a>) in
278         * Jerusalem <a href="https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox
279         * / equilux</a>, which calculates to 4.61&deg; below {@link #GEOMETRIC_ZENITH geometric zenith}.
280         * @todo add documentation links
281         * 
282         * @see #getTzaisGeonim4Point61Degrees()
283         */
284        protected static final double ZENITH_4_POINT_61 = GEOMETRIC_ZENITH + 4.61;
285
286        /**
287         * The zenith of 4.8&deg; below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;).
288         * @todo Add more documentation.
289         * @see #getTzaisGeonim4Point8Degrees()
290         */
291        protected static final double ZENITH_4_POINT_8 = GEOMETRIC_ZENITH + 4.8;
292
293        /**
294         * The zenith of 3.65&deg; below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is used for
295         * calculating <em>tzais</em> (nightfall) according to some opinions. This calculation is based on the position of
296         * the sun {@link #getTzaisGeonim3Point65Degrees() 13.5 minutes} after sunset (3/4 of an 18-minute <a href=
297         * "https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a>) in Jerusalem <a href=
298         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a> which
299         * calculates to 3.65&deg; below {@link #GEOMETRIC_ZENITH geometric zenith}.
300         * @deprecated This will be removed in v3.0.0 since calculations show that this time is earlier than 13.5 minutes at
301         *              the <a href="https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the
302         *              equinox / equilux</a> in Jerusalem.
303         * 
304         * @see #getTzaisGeonim3Point65Degrees()
305         */
306        @Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
307        protected static final double ZENITH_3_POINT_65 = GEOMETRIC_ZENITH + 3.65;
308
309        /**
310         * The zenith of 3.676&deg; below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;).
311         * @todo Add more documentation.
312         * @deprecated This will be removed in v3.0.0 since calculations show that this time is earlier than 13.5 minutes at
313         *              the <a href="https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the
314         *              equinox / equilux</a> in Jerusalem.
315         */
316        @Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
317        protected static final double ZENITH_3_POINT_676 = GEOMETRIC_ZENITH + 3.676;
318
319        /**
320         * The zenith of 5.88&deg; below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;).
321         * @todo Add more documentation.
322         */
323        protected static final double ZENITH_5_POINT_88 = GEOMETRIC_ZENITH + 5.88;
324
325        /**
326         * The zenith of 1.583&deg; below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is used for
327         * calculating <em>netz amiti</em> (sunrise) and <em>shkiah amiti</em> (sunset) based on the opinion of the
328         * <a href="https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi">Baal Hatanya</a>.
329         *
330         * @see #getSunriseBaalHatanya()
331         * @see #getSunsetBaalHatanya()
332         */
333        protected static final double ZENITH_1_POINT_583 = GEOMETRIC_ZENITH + 1.583;
334
335        /**
336         * The zenith of 16.9&deg; below geometric zenith (90&deg;). This calculation is used for determining <em>alos</em>
337         * (dawn) based on the opinion of the Baal Hatanya. It is based on the calculation that the time between dawn
338         * and <em>netz amiti</em> (sunrise) is 72 minutes, the time that is takes to walk 4 mil at 18 minutes
339         * a mil (<a href="https://en.wikipedia.org/wiki/Maimonides">Rambam</a> and others). The sun's position at 72
340         * minutes before {@link #getSunriseBaalHatanya <em>netz amiti</em> (sunrise)} in Jerusalem <a href=
341         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a> is
342         * 16.9&deg; below {@link #GEOMETRIC_ZENITH geometric zenith}.
343         *
344         * @see #getAlosBaalHatanya()
345         */
346        protected static final double ZENITH_16_POINT_9 = GEOMETRIC_ZENITH + 16.9;
347
348        /**
349         * The zenith of 6&deg; below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is used for
350         * calculating <em>tzais</em> / nightfall based on the opinion of the Baal Hatanya. This calculation is based on the
351         * position of the sun 24 minutes after {@link #getSunset() sunset} in Jerusalem <a href=
352         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a>, which
353         * is 6&deg; below {@link #GEOMETRIC_ZENITH geometric zenith}.
354         *
355         * @see #getTzaisBaalHatanya()
356         */
357        protected static final double ZENITH_6_DEGREES = GEOMETRIC_ZENITH + 6;
358
359        /**
360         * The zenith of 6.45&deg; below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is used for
361         * calculating <em>tzais</em> (nightfall) according to some opinions. This is based on the calculations of <a href=
362         * "https://en.wikipedia.org/wiki/Yechiel_Michel_Tucazinsky">Rabbi Yechiel Michel Tucazinsky</a> of the position of
363         * the sun no later than {@link #getTzaisGeonim6Point45Degrees() 31 minutes} after sunset in Jerusalem, and at the
364         * height of the summer solstice, this <em>zman</em> is 28 minutes after <em>shkiah</em>. This computes to 6.45&deg;
365         * below {@link #GEOMETRIC_ZENITH geometric zenith}. This calculation is found in the <a href=
366         * "https://hebrewbooks.org/pdfpager.aspx?req=50536&st=&pgnum=51">Birur Halacha Yoreh Deah 262</a> it the commonly
367         * used <em>zman</em> in Israel. It should be noted that this differs from the 6.1&deg;/6.2&deg; calculation for
368         * Rabbi Tucazinsky's time as calculated by the Hazmanim Bahalacha Vol II chapter 50:7 (page 515).
369         * 
370         * @see #getTzaisGeonim6Point45Degrees()
371         */
372        protected static final double ZENITH_6_POINT_45 = GEOMETRIC_ZENITH + 6.45;
373        
374        /**
375         * The zenith of 7.65&deg; below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is used for
376         * calculating <em>misheyakir</em> according to some opinions.
377         * 
378         * @see #getMisheyakir7Point65Degrees()
379         */
380        protected static final double ZENITH_7_POINT_65 = GEOMETRIC_ZENITH + 7.65;
381        
382        /**
383         * The zenith of 7.67&deg; below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is used for
384         * calculating <em>tzais</em> according to some opinions.
385         * 
386         * @see #getTzaisGeonim7Point67Degrees()
387         */
388        protected static final double ZENITH_7_POINT_67 = GEOMETRIC_ZENITH + 7.67;
389        
390        /**
391         * The zenith of 9.3&deg; below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is used for
392         * calculating <em>tzais</em> (nightfall) according to some opinions.
393         * 
394         * @see #getTzaisGeonim9Point3Degrees()
395         */
396        protected static final double ZENITH_9_POINT_3 = GEOMETRIC_ZENITH + 9.3;
397        
398        /**
399         * The zenith of 9.5&deg; below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is used for
400         * calculating <em>misheyakir</em> according to some opinions.
401         * 
402         * @see #getMisheyakir9Point5Degrees()
403         */
404        protected static final double ZENITH_9_POINT_5 = GEOMETRIC_ZENITH + 9.5;
405        
406        /**
407         * The zenith of 9.75&deg; below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is used for
408         * calculating <em>alos</em> (dawn) and <em>tzais</em> (nightfall) according to some opinions.
409         * 
410         * @see #getTzaisGeonim9Point75Degrees()
411         */
412        protected static final double ZENITH_9_POINT_75 = GEOMETRIC_ZENITH + 9.75;
413        
414        /**
415         * The zenith of 2.1&deg; above {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is used for
416         * calculating the start of <em>bain hashmashos</em> (twilight) of 13.5 minutes before sunset converted to degrees
417         * according to the Yereim. As is traditional with degrees below the horizon, this is calculated without refraction
418         * and from the center of the sun. It would be 0.833&deg; less without this.
419         * 
420         * @see #getBainHashmashosYereim2Point1Degrees()
421         */
422        protected static final double ZENITH_MINUS_2_POINT_1 = GEOMETRIC_ZENITH - 2.1;
423        
424        /**
425         * The zenith of 2.8&deg; above {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is used for
426         * calculating the start of <em>bain hashmashos</em> (twilight) of 16.875 minutes before sunset converted to degrees
427         * according to the Yereim. As is traditional with degrees below the horizon, this is calculated without refraction
428         * and from the center of the sun. It would be 0.833&deg; less without this.
429         * 
430         * @see #getBainHashmashosYereim2Point8Degrees()
431         */
432        protected static final double ZENITH_MINUS_2_POINT_8 = GEOMETRIC_ZENITH - 2.8;
433        
434        /**
435         * The zenith of 3.05&deg; above {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is used for
436         * calculating the start of <em>bain hashmashos</em> (twilight) of 18 minutes before sunset converted to degrees
437         * according to the Yereim. As is traditional with degrees below the horizon, this is calculated without refraction
438         * and from the center of the sun. It would be 0.833&deg; less without this.
439         * 
440         * @see #getBainHashmashosYereim3Point05Degrees()
441         */
442        protected static final double ZENITH_MINUS_3_POINT_05 = GEOMETRIC_ZENITH - 3.05;
443
444        /**
445         * The offset in minutes (defaults to 40) after sunset used for <em>tzeit</em> based on calculations of
446         * <em>Chacham</em> Yosef Harari-Raful of Yeshivat Ateret Torah.
447         * @see #getTzaisAteretTorah()
448         * @see #getAteretTorahSunsetOffset()
449         * @see #setAteretTorahSunsetOffset(double)
450         */
451        private double ateretTorahSunsetOffset = 40;
452
453        /**
454         * A constructor that takes a {@link GeoLocation} as a parameter.
455         * 
456         * @param location
457         *            the location
458         * 
459         * @see ZmanimCalendar#ZmanimCalendar(GeoLocation)
460         */
461        public ComplexZmanimCalendar(GeoLocation location) {
462                super(location);
463        }
464
465        /**
466         * Default constructor will set a default {@link GeoLocation#GeoLocation()}, a default
467         * {@link AstronomicalCalculator#getDefault() AstronomicalCalculator} and default the calendar to the current date.
468         * 
469         * @see AstronomicalCalendar#AstronomicalCalendar()
470         * @see #ComplexZmanimCalendar(GeoLocation)
471         */
472        public ComplexZmanimCalendar() {
473                super();
474        }
475
476        /**
477         * Method to return a <em>shaah zmanis</em> (temporal hour) calculated using a 19.8&deg; dip. This calculation
478         * divides the day based on the opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen
479         * Avraham (MGA)</a> that the day runs from dawn to dusk. Dawn for this calculation is when the sun is 19.8&deg;
480         * below the eastern geometric horizon before sunrise. Dusk for this is when the sun is 19.8&deg; below the western
481         * geometric horizon after sunset. This day is split into 12 equal parts with each part being a <em>shaah zmanis</em>.
482         * 
483         * @return the <code>long</code> millisecond length of a <em>shaah zmanis</em>. If the calculation can't be computed
484         *         such as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
485         *         where the sun may not reach low enough below the horizon for this calculation, a {@link Long#MIN_VALUE}
486         *         will be returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
487         */
488        public long getShaahZmanis19Point8Degrees() {
489                return getTemporalHour(getAlos19Point8Degrees(), getTzais19Point8Degrees());
490        }
491
492        /**
493         * Method to return a <em>shaah zmanis</em> (temporal hour) calculated using a 18&deg; dip. This calculation divides
494         * the day based on the opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham
495         * (MGA)</a> that the day runs from dawn to dusk. Dawn for this calculation is when the sun is 18&deg; below the
496         * eastern geometric horizon before sunrise. Dusk for this is when the sun is 18&deg; below the western geometric
497         * horizon after sunset. This day is split into 12 equal parts with each part being a <em>shaah zmanis</em>.
498         * 
499         * @return the <code>long</code> millisecond length of a <em>shaah zmanis</em>. If the calculation can't be computed
500         *         such as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
501         *         where the sun may not reach low enough below the horizon for this calculation, a {@link Long#MIN_VALUE}
502         *         will be returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
503         */
504        public long getShaahZmanis18Degrees() {
505                return getTemporalHour(getAlos18Degrees(), getTzais18Degrees());
506        }
507
508        /**
509         * Method to return a <em>shaah zmanis</em> (temporal hour) calculated using a dip of 26&deg;. This calculation
510         * divides the day based on the opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen
511         * Avraham (MGA)</a> that the day runs from dawn to dusk. Dawn for this calculation is when the sun is
512         * {@link #getAlos26Degrees() 26&deg;} below the eastern geometric horizon before sunrise. Dusk for this is when
513         * the sun is {@link #getTzais26Degrees() 26&deg;} below the western geometric horizon after sunset. This day is
514         * split into 12 equal parts with each part being a <em>shaah zmanis</em>. Since <em>zmanim</em> that use this
515         * method are extremely late or early and at a point when the sky is a long time past the 18&deg; point where the
516         * darkest point is reached, <em>zmanim</em> that use this should only be used <em>lechumra</em>, such as
517         * delaying the start of nighttime <em>mitzvos</em>.
518         * 
519         * @return the <code>long</code> millisecond length of a <em>shaah zmanis</em>. If the calculation can't be computed
520         *         such as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
521         *         where the sun may not reach low enough below the horizon for this calculation, a {@link Long#MIN_VALUE}
522         *         will be returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
523         * @see #getShaahZmanis120Minutes()
524         */
525        public long getShaahZmanis26Degrees() {
526                return getTemporalHour(getAlos26Degrees(), getTzais26Degrees());
527        }
528
529        /**
530         * Method to return a <em>shaah zmanis</em> (temporal hour) calculated using a dip of 16.1&deg;. This calculation
531         * divides the day based on the opinion that the day runs from dawn to dusk. Dawn for this calculation is when the
532         * sun is 16.1&deg; below the eastern geometric horizon before sunrise and dusk is when the sun is 16.1&deg; below
533         * the western geometric horizon after sunset. This day is split into 12 equal parts with each part being a
534         * <em>shaah zmanis</em>.
535         * 
536         * @return the <code>long</code> millisecond length of a <em>shaah zmanis</em>. If the calculation can't be computed
537         *         such as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
538         *         where the sun may not reach low enough below the horizon for this calculation, a {@link Long#MIN_VALUE}
539         *         will be returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
540         * 
541         * @see #getAlos16Point1Degrees()
542         * @see #getTzais16Point1Degrees()
543         * @see #getSofZmanShmaMGA16Point1Degrees()
544         * @see #getSofZmanTfilaMGA16Point1Degrees()
545         * @see #getMinchaGedola16Point1Degrees()
546         * @see #getMinchaKetana16Point1Degrees()
547         * @see #getPlagHamincha16Point1Degrees()
548         */
549
550        public long getShaahZmanis16Point1Degrees() {
551                return getTemporalHour(getAlos16Point1Degrees(), getTzais16Point1Degrees());
552        }
553
554        /**
555         * Method to return a <em>shaah zmanis</em> (solar hour) according to the opinion of the <a href=
556         * "https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a>. This calculation
557         * divides the day based on the opinion of the MGA that the day runs from dawn to dusk. Dawn for this calculation is
558         * 60 minutes before sunrise and dusk is 60 minutes after sunset. This day is split into 12 equal parts with each
559         * part being a <em>shaah zmanis</em>. Alternate methods of calculating a <em>shaah zmanis</em> are available in the
560         * subclass {@link ComplexZmanimCalendar}.
561         * 
562         * @return the <code>long</code> millisecond length of a <em>shaah zmanis</em>. If the calculation can't be computed
563         *         such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
564         *         where it does not set, a {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the
565         *         {@link AstronomicalCalendar} documentation.
566         * 
567         * @see #getAlos60()
568         * @see #getTzais60()
569         * @see #getPlagHamincha60Minutes()
570         */
571        public long getShaahZmanis60Minutes() {
572                return getTemporalHour(getAlos60(), getTzais60());
573        }
574
575        /**
576         * Method to return a <em>shaah zmanis</em> (solar hour) according to the opinion of the <a href=
577         * "https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a>. This calculation divides the day
578         * based on the opinion of the MGA that the day runs from dawn to dusk. Dawn for this calculation is 72 minutes
579         * before sunrise and dusk is 72 minutes after sunset. This day is split into 12 equal parts with each part
580         * being a <em>shaah zmanis</em>. Alternate methods of calculating a <em>shaah zmanis</em> are available in the
581         * subclass {@link ComplexZmanimCalendar}.
582         * 
583         * @return the <code>long</code> millisecond length of a <em>shaah zmanis</em>. If the calculation can't be computed
584         *         such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
585         *         where it does not set, a {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the
586         *         {@link AstronomicalCalendar} documentation.
587         */
588        public long getShaahZmanis72Minutes() {
589                return getShaahZmanisMGA();
590        }
591
592        /**
593         * Method to return a <em>shaah zmanis</em> (temporal hour) according to the opinion of the <a href=
594         * "https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on <em>alos</em> being
595         * {@link #getAlos72Zmanis() 72} minutes <em>zmaniyos</em> before {@link #getSunrise() sunrise}. This calculation
596         * divides the day based on the opinion of the MGA that the day runs from dawn to dusk. Dawn for this calculation
597         * is 72 minutes <em>zmaniyos</em> before sunrise and dusk is 72 minutes <em>zmaniyos</em> after sunset. This day
598         * is split into 12 equal parts with each part being a <em>shaah zmanis</em>. This is identical to 1/10th of the day
599         * from {@link #getSunrise() sunrise} to {@link #getSunset() sunset}.
600         * 
601         * @return the <code>long</code> millisecond length of a <em>shaah zmanis</em>. If the calculation can't be computed
602         *         such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
603         *         where it does not set, a {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the
604         *         {@link AstronomicalCalendar} documentation.
605         * @see #getAlos72Zmanis()
606         * @see #getTzais72Zmanis()
607         */
608        public long getShaahZmanis72MinutesZmanis() {
609                return getTemporalHour(getAlos72Zmanis(), getTzais72Zmanis());
610        }
611
612        /**
613         * Method to return a <em>shaah zmanis</em> (temporal hour) calculated using a dip of 90 minutes. This calculation
614         * divides the day based on the opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen
615         * Avraham (MGA)</a> that the day runs from dawn to dusk. Dawn for this calculation is 90 minutes before sunrise
616         * and dusk is 90 minutes after sunset. This day is split into 12 equal parts with each part being a <em>shaah zmanis</em>.
617         * 
618         * @return the <code>long</code> millisecond length of a <em>shaah zmanis</em>. If the calculation can't be computed
619         *         such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
620         *         where it does not set, a {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the
621         *         {@link AstronomicalCalendar} documentation.
622         */
623        public long getShaahZmanis90Minutes() {
624                return getTemporalHour(getAlos90(), getTzais90());
625        }
626
627        /**
628         * Method to return a <em>shaah zmanis</em> (temporal hour) according to the opinion of the <a href=
629         * "https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on <em>alos</em> being
630         * {@link #getAlos90Zmanis() 90} minutes <em>zmaniyos</em> before {@link #getSunrise() sunrise}. This calculation divides
631         * the day based on the opinion of the MGA that the day runs from dawn to dusk. Dawn for this calculation is 90 minutes
632         * <em>zmaniyos</em> before sunrise and dusk is 90 minutes <em>zmaniyos</em> after sunset. This day is split into 12 equal
633         * parts with each part being a <em>shaah zmanis</em>. This is 1/8th of the day from {@link #getSunrise() sunrise} to
634         * {@link #getSunset() sunset}.
635         * 
636         * @return the <code>long</code> millisecond length of a <em>shaah zmanis</em>. If the calculation can't be computed
637         *         such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
638         *         where it does not set, a {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the
639         *         {@link AstronomicalCalendar} documentation.
640         * @see #getAlos90Zmanis()
641         * @see #getTzais90Zmanis()
642         */
643        public long getShaahZmanis90MinutesZmanis() {
644                return getTemporalHour(getAlos90Zmanis(), getTzais90Zmanis());
645        }
646
647        /**
648         * Method to return a <em>shaah zmanis</em> (temporal hour) according to the opinion of the <a href=
649         * "https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on <em>alos</em> being {@link
650         * #getAlos96Zmanis() 96} minutes <em>zmaniyos</em> before {@link #getSunrise() sunrise}. This calculation divides the
651         * day based on the opinion of the MGA that the day runs from dawn to dusk. Dawn for this calculation is 96 minutes
652         * <em>zmaniyos</em> before sunrise and dusk is 96 minutes <em>zmaniyos</em> after sunset. This day is split into 12
653         * equal parts with each part being a <em>shaah zmanis</em>. This is identical to 1/7.5th of the day from
654         * {@link #getSunrise() sunrise} to {@link #getSunset() sunset}.
655         * 
656         * @return the <code>long</code> millisecond length of a <em>shaah zmanis</em>. If the calculation can't be computed
657         *         such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
658         *         where it does not set, a {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the
659         *         {@link AstronomicalCalendar} documentation.
660         * @see #getAlos96Zmanis()
661         * @see #getTzais96Zmanis()
662         */
663        public long getShaahZmanis96MinutesZmanis() {
664                return getTemporalHour(getAlos96Zmanis(), getTzais96Zmanis());
665        }
666
667        /**
668         * Method to return a <em>shaah zmanis</em> (temporal hour) according to the opinion of the
669         * <em>Chacham</em> Yosef Harari-Raful of Yeshivat Ateret Torah calculated with <em>alos</em> being 1/10th
670         * of sunrise to sunset day, or {@link #getAlos72Zmanis() 72} minutes <em>zmaniyos</em> of such a day before
671         * {@link #getSunrise() sunrise}, and <em>tzais</em> is usually calculated as {@link #getTzaisAteretTorah() 40
672         * minutes} (configurable to any offset via {@link #setAteretTorahSunsetOffset(double)}) after {@link #getSunset()
673         * sunset}. This day is split into 12 equal parts with each part being a <em>shaah zmanis</em>. Note that with this
674         * system, <em>chatzos</em> (midday) will not be the point that the sun is {@link #getSunTransit() halfway across
675         * the sky}.
676         * 
677         * @return the <code>long</code> millisecond length of a <em>shaah zmanis</em>. If the calculation can't be computed
678         *         such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
679         *         where it does not set, a {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the
680         *         {@link AstronomicalCalendar} documentation.
681         * @see #getAlos72Zmanis()
682         * @see #getTzaisAteretTorah()
683         * @see #getAteretTorahSunsetOffset()
684         * @see #setAteretTorahSunsetOffset(double)
685         */
686        public long getShaahZmanisAteretTorah() {
687                return getTemporalHour(getAlos72Zmanis(), getTzaisAteretTorah());
688        }
689        
690        /**
691         * Method to return a <em>shaah zmanis</em> (temporal hour) used by some <em>zmanim</em> according to the opinion of
692         * <a href="https://en.wikipedia.org/wiki/Yaakov_Moshe_Hillel">Rabbi Yaakov Moshe Hillel</a> as published in the
693         * <em>luach</em> of the Bais Horaah of Yeshivat Chevrat Ahavat Shalom that is based on a day starting 72 minutes before
694         * sunrise in degrees {@link #getAlos16Point1Degrees() <em>alos</em> 16.1&deg;} and ending 14 minutes after sunset in
695         * degrees {@link #getTzaisGeonim3Point8Degrees() <em>tzais</em> 3.8&deg;}. This day is split into 12 equal parts with
696         * each part being a <em>shaah zmanis</em>. Note that with this system, <em>chatzos</em> (midday) will not be the point
697         * that the sun is {@link #getSunTransit() halfway across the sky}. These <em>shaos zmaniyos</em> are used for <em>Mincha
698         * Ketana</em> and <em>Plag Hamincha</em>. The 14 minutes are based on 3/4 of an 18 minute <a href=
699         * "https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement" >mil</a>, with half a minute added for
700         * Rav Yosi.
701         * 
702         * @return the <code>long</code> millisecond length of a <em>shaah zmanis</em>. If the calculation can't be computed
703         *         such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
704         *         where it does not set, a {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the
705         *         {@link AstronomicalCalendar} documentation.
706         * 
707         * @see #getMinchaKetanaAhavatShalom()
708         * @see #getPlagAhavatShalom()
709         */
710        public long getShaahZmanisAlos16Point1ToTzais3Point8() {
711                return getTemporalHour(getAlos16Point1Degrees(), getTzaisGeonim3Point8Degrees());
712        }
713        
714        /**
715         * Method to return a <em>shaah zmanis</em> (temporal hour) used by some <em>zmanim</em> according to the opinion of
716         * <a href="https://en.wikipedia.org/wiki/Yaakov_Moshe_Hillel">Rabbi Yaakov Moshe Hillel</a> as published in the
717         * <em>luach</em> of the Bais Horaah of Yeshivat Chevrat Ahavat Shalom that is based on a day starting 72 minutes before
718         * sunrise in degrees {@link #getAlos16Point1Degrees() <em>alos</em> 16.1&deg;} and ending 13.5 minutes after sunset in
719         * degrees {@link #getTzaisGeonim3Point7Degrees() <em>tzais</em> 3.7&deg;}. This day is split into 12 equal parts with
720         * each part being a <em>shaah zmanis</em>. Note that with this system, <em>chatzos</em> (midday) will not be the point
721         * that the sun is {@link #getSunTransit() halfway across the sky}. These <em>shaos zmaniyos</em> are used for <em>Mincha
722         * Gedola</em> calculation.
723         * 
724         * @return the <code>long</code> millisecond length of a <em>shaah zmanis</em>. If the calculation can't be computed
725         *         such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
726         *         where it does not set, a {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the
727         *         {@link AstronomicalCalendar} documentation.
728         * 
729         * @see #getMinchaGedolaAhavatShalom()
730         */
731        public long getShaahZmanisAlos16Point1ToTzais3Point7() {
732                return getTemporalHour(getAlos16Point1Degrees(), getTzaisGeonim3Point7Degrees());
733        }
734
735        /**
736         * Method to return a <em>shaah zmanis</em> (temporal hour) calculated using a dip of 96 minutes. This calculation
737         * divides the day based on the opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen
738         * Avraham (MGA)</a> that the day runs from dawn to dusk. Dawn for this calculation is 96 minutes before sunrise
739         * and dusk is 96 minutes after sunset. This day is split into 12 equal parts with each part being a <em>shaah
740         * zmanis</em>.
741         * 
742         * @return the <code>long</code> millisecond length of a <em>shaah zmanis</em>. If the calculation can't be computed
743         *         such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
744         *         where it does not set, a {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the
745         *         {@link AstronomicalCalendar} documentation.
746         */
747        public long getShaahZmanis96Minutes() {
748                return getTemporalHour(getAlos96(), getTzais96());
749        }
750
751        /**
752         * Method to return a <em>shaah zmanis</em> (temporal hour) calculated using a dip of 120 minutes. This calculation
753         * divides the day based on the opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen
754         * Avraham (MGA)</a> that the day runs from dawn to dusk. Dawn for this calculation is 120 minutes before sunrise and
755         * dusk is 120 minutes after sunset. This day is split into 12 equal parts with each part being a <em>shaah zmanis</em>.
756         * Since <em>zmanim</em> that use this method are extremely late or early and at a point when the sky is a long time
757         * past the 18&deg; point where the darkest point is reached, <em>zmanim</em> that use this should only be used
758         * <em>lechumra</em> only, such as delaying the start of nighttime <em>mitzvos</em>.
759         * 
760         * @return the <code>long</code> millisecond length of a <em>shaah zmanis</em>. If the calculation can't be computed
761         *         such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
762         *         where it does not set, a {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the
763         *         {@link AstronomicalCalendar} documentation.
764         * @see #getShaahZmanis26Degrees()
765         */
766        public long getShaahZmanis120Minutes() {
767                return getTemporalHour(getAlos120(), getTzais120());
768        }
769
770        /**
771         * Method to return a <em>shaah zmanis</em> (temporal hour) according to the opinion of the <a href=
772         * "https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on <em>alos</em> being {@link
773         * #getAlos120Zmanis() 120} minutes <em>zmaniyos</em> before {@link #getSunrise() sunrise}. This calculation divides
774         * the day based on the opinion of the MGA that the day runs from dawn to dusk. Dawn for this calculation is
775         * 120 minutes <em>zmaniyos</em> before sunrise and dusk is 120 minutes <em>zmaniyos</em> after sunset. This day is
776         * split into 12 equal parts with each part being a <em>shaah zmanis</em>. This is identical to 1/6th of the day from
777         * {@link #getSunrise() sunrise} to {@link #getSunset() sunset}. Since <em>zmanim</em> that use this method are
778         * extremely late or early and at a point when the sky is a long time past the 18&deg; point where the darkest point
779         * is reached, <em>zmanim</em> that use this should only be used <em>lechumra</em> such as delaying the start of
780         * nighttime <em>mitzvos</em>.
781         * 
782         * @return the <code>long</code> millisecond length of a <em>shaah zmanis</em>. If the calculation can't be computed
783         *         such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
784         *         where it does not set, a {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the
785         *         {@link AstronomicalCalendar} documentation.
786         * @see #getAlos120Zmanis()
787         * @see #getTzais120Zmanis()
788         */
789        public long getShaahZmanis120MinutesZmanis() {
790                return getTemporalHour(getAlos120Zmanis(), getTzais120Zmanis());
791        }
792
793        /**
794         * This method should be used <em>lechumra</em> only and returns the time of <em>plag hamincha</em> based on sunrise
795         * being 120 minutes <em>zmaniyos</em> or 1/6th of the day before sunrise. This is calculated as 10.75 hours after
796         * {@link #getAlos120Zmanis() dawn}. The formula used is 10.75 * {@link #getShaahZmanis120MinutesZmanis()} after
797         * {@link #getAlos120Zmanis() dawn}. Since the <em>zman</em> based on an extremely early <em>alos</em> and a very
798         * late <em>tzais</em>, it should only be used <em>lechumra</em>.
799         * 
800         * @deprecated This method should be used <em>lechumra</em> only since it returns a very late time (often after
801         *         <em>shkiah</em>), and if used <em>lekula</em> can result in <em>chillul Shabbos</em> etc. There is no
802         *         current plan to remove this method from the API, and this deprecation is intended to alert developers
803         *         of the danger of using it.
804         * 
805         * @return the <code>Date</code> of the time of <em>plag hamincha</em>. If the calculation can't be computed such as
806         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
807         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
808         *         {@link AstronomicalCalendar} documentation.
809         * 
810         * @see #getShaahZmanis120MinutesZmanis()
811         * @see #getAlos120()
812         * @see #getTzais120()
813         * @see #getPlagHamincha26Degrees()
814         * @see #getPlagHamincha120Minutes()
815         */
816        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
817        public Date getPlagHamincha120MinutesZmanis() {
818                return getPlagHamincha(getAlos120Zmanis(), getTzais120Zmanis(), true);
819        }
820
821        /**
822         * This method should be used <em>lechumra</em> only and returns the time of <em>plag hamincha</em> according to the
823         * Magen Avraham with the day starting 120 minutes before sunrise and ending 120 minutes after sunset. This is
824         * calculated as 10.75 hours after {@link #getAlos120() dawn 120 minutes}. The formula used is 10.75 {@link
825         * #getShaahZmanis120Minutes()} after {@link #getAlos120()}. Since the <em>zman</em> based on an extremely early
826         * <em>alos</em> and a very late <em>tzais</em>, it should only be used <em>lechumra</em>.
827         * 
828         * @deprecated This method should be used <em>lechumra</em> only since it returns a very late time (often after
829         *         <em>shkiah</em>), and if used <em>lekula</em> can result in <em>chillul Shabbos</em> etc. There is no
830         *         current plan to remove this method from the API, and this deprecation is intended to alert developers
831         *         of the danger of using it.
832         * 
833         * @return the <code>Date</code> of the time of <em>plag hamincha</em>. If the calculation can't be computed such as
834         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
835         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
836         *         {@link AstronomicalCalendar} documentation.
837         * 
838         * @see #getShaahZmanis120Minutes()
839         * @see #getPlagHamincha26Degrees()
840         */
841        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
842        public Date getPlagHamincha120Minutes() {
843                return getPlagHamincha(getAlos120(), getTzais120(), true);
844        }
845
846        /**
847         * Method to return <em>alos</em> (dawn) calculated as 60 minutes before {@link #getSunrise() sunrise} or
848         * {@link #getSeaLevelSunrise() sea level sunrise} (depending on the {@link #isUseElevation()} setting). This is the
849         * time to walk the distance of 4 <a href="https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement"
850         * >mil</a> at 15 minutes a mil. This seems to be the opinion of the
851         * <a href="https://en.wikipedia.org/wiki/Yair_Bacharach">Chavas Yair</a> in the Mekor Chaim, Orach Chaim Ch. 90,
852         * though  the Mekor Chaim in Ch. 58 and in the <a href="https://hebrewbooks.org/pdfpager.aspx?req=45193&pgnum=214"
853         * >Chut Hashani Ch. 97</a> states that a person walks 3 and a 1/3 mil in an hour, or an 18-minute mil.
854         * Also see the <a href=
855         * "https://he.wikipedia.org/wiki/%D7%9E%D7%9C%D7%9B%D7%99%D7%90%D7%9C_%D7%A6%D7%91%D7%99_%D7%98%D7%A0%D7%A0%D7%91%D7%95%D7%99%D7%9D"
856         * >Divrei Malkiel</a> <a href="https://hebrewbooks.org/pdfpager.aspx?req=803&pgnum=33">Vol. 4, Ch. 20, page 34</a>) who
857         * mentions the 15 minute mil <em>lechumra</em> by baking matzos. Also see the <a href=
858         * "https://en.wikipedia.org/wiki/Joseph_Colon_Trabotto">Maharik</a> <a href=
859         * "https://hebrewbooks.org/pdfpager.aspx?req=1142&pgnum=216">Ch. 173</a> where the questioner quoting the
860         * <a href="https://en.wikipedia.org/wiki/Eliezer_ben_Nathan">Ra'avan</a> is of the opinion that the time to walk a
861         * mil is 15 minutes (5 mil in a little over an hour). There are many who believe that there is a
862         * <em>ta'us sofer</em> (scribe's error) in the Ra'avan, and it should 4 mil in a little over an hour, or an
863         * 18-minute mil. Time based offset calculations are based on the opinion of the
864         * <em><a href="https://en.wikipedia.org/wiki/Rishonim">Rishonim</a></em> who stated that the time of the <em>neshef</em>
865         * (time between dawn and sunrise) does not vary by the time of year or location but purely depends on the time it takes to
866         * walk the distance of 4* mil. {@link #getTzaisGeonim9Point75Degrees()} is a related <em>zman</em> that is a
867         * degree-based calculation based on 60 minutes.
868         * 
869         * @return the <code>Date</code> representing the time. If the calculation can't be computed such as in the Arctic
870         *         Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
871         *         a <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}.
872         *         documentation.
873         *
874         * @see #getTzais60()
875         * @see #getPlagHamincha60Minutes()
876         * @see #getShaahZmanis60Minutes()
877         */
878        public Date getAlos60() {
879                return getTimeOffset(getElevationAdjustedSunrise(), -60 * MINUTE_MILLIS);
880        }
881
882        /**
883         * Method to return <em>alos</em> (dawn) calculated using 72 minutes <em>zmaniyos</em> or 1/10th of the day before
884         * sunrise. This is based on an 18-minute <a href=
885         * "https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a> so the time for 4 mil is
886         * 72 minutes which is 1/10th of a day (12 * 60 = 720) based on the day being from {@link #getSeaLevelSunrise() sea
887         * level sunrise} to {@link #getSeaLevelSunset() sea level sunset} or {@link #getSunrise() sunrise} to {@link #getSunset()
888         * sunset} (depending on the {@link #isUseElevation()} setting). The actual calculation is {@link #getSeaLevelSunrise()} -
889         * ({@link #getShaahZmanisGra()} * 1.2). This calculation is used in the calendars published by the <a href=
890         * "https://en.wikipedia.org/wiki/Central_Rabbinical_Congress">Hisachdus Harabanim D'Artzos Habris Ve'Canada</a>.
891         * 
892         * @return the <code>Date</code> representing the time. If the calculation can't be computed such as in the Arctic
893         *         Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
894         *         a <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
895         *         documentation.
896         * @see #getShaahZmanisGra()
897         */
898        public Date getAlos72Zmanis() {
899                return getZmanisBasedOffset(-1.2);
900        }
901
902        /**
903         * Method to return <em>alos</em> (dawn) calculated using 96 minutes before {@link #getSunrise() sunrise} or
904         * {@link #getSeaLevelSunrise() sea level sunrise} (depending on the {@link #isUseElevation()} setting) that is based
905         * on the time to walk the distance of 4 <a href=
906         * "https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a> at 24 minutes a mil.
907         * Time based offset calculations for <em>alos</em> are based on the opinion of the <em><a href=
908         * "https://en.wikipedia.org/wiki/Rishonim">Rishonim</a></em> who stated that the time of the <em>Neshef</em> (time between
909         * dawn and sunrise) does not vary by the time of year or location but purely depends on the time it takes to walk the
910         * distance of 4 mil.
911         * 
912         * @return the <code>Date</code> representing the time. If the calculation can't be computed such as in the Arctic
913         *         Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
914         *         a <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
915         *         documentation.
916         */
917        public Date getAlos96() {
918                return getTimeOffset(getElevationAdjustedSunrise(), -96 * MINUTE_MILLIS);
919        }
920
921        /**
922         * Method to return <em>alos</em> (dawn) calculated using 90 minutes <em>zmaniyos</em> or 1/8th of the day before
923         * {@link #getSunrise() sunrise} or {@link #getSeaLevelSunrise() sea level sunrise} (depending on the {@link
924         * #isUseElevation()} setting). This is based on a 22.5-minute <a href=
925         * "https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a> so the time for 4
926         * mil is 90 minutes which is 1/8th of a day (12 * 60) / 8 = 90. The day is calculated from {@link
927         * #getSeaLevelSunrise() sea level sunrise} to {@link #getSeaLevelSunset() sea level sunset} or {@link #getSunrise()
928         * sunrise} to {@link #getSunset() sunset} (depending on the {@link #isUseElevation()}. The actual calculation used
929         * is {@link #getSunrise()} - ({@link #getShaahZmanisGra()} * 1.5).
930         * 
931         * @return the <code>Date</code> representing the time. If the calculation can't be computed such as in the Arctic
932         *         Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
933         *         a <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
934         *         documentation.
935         * @see #getShaahZmanisGra()
936         */
937        public Date getAlos90Zmanis() {
938                return getZmanisBasedOffset(-1.5);
939        }
940
941        /**
942         * This method returns <em>alos</em> (dawn) calculated using 96 minutes <em>zmaniyos</em> or 1/7.5th of the day before
943         * {@link #getSunrise() sunrise} or {@link #getSeaLevelSunrise() sea level sunrise} (depending on the {@link
944         * #isUseElevation()} setting). This is based on a 24-minute <a href=
945         * "https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a> so the time for 4 mil is 96
946         * minutes which is 1/7.5th of a day (12 * 60 / 7.5 = 96). The day is calculated from {@link #getSeaLevelSunrise() sea
947         * level sunrise} to {@link #getSeaLevelSunset() sea level sunset} or {@link #getSunrise() sunrise} to {@link #getSunset()
948         * sunset} (depending on the {@link #isUseElevation()}. The actual calculation used is {@link #getSunrise()} -
949         * ({@link #getShaahZmanisGra()} * 1.6).
950         * 
951         * @return the <code>Date</code> representing the time. If the calculation can't be computed such as in the Arctic
952         *         Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
953         *         a <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
954         *         documentation.
955         * @see #getShaahZmanisGra()
956         */
957        public Date getAlos96Zmanis() {
958                return getZmanisBasedOffset(-1.6);
959        }
960
961        /**
962         * Method to return <em>alos</em> (dawn) calculated using 90 minutes before {@link #getSeaLevelSunrise() sea level
963         * sunrise} based on the time to walk the distance of 4 <a href=
964         * "https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a> at 22.5 minutes a
965         * mil. Time-based offset calculations for <em>alos</em> are based on the opinion of the <em><a href=
966         * "https://en.wikipedia.org/wiki/Rishonim">Rishonim</a></em> who stated that the time of the <em>Neshef</em>
967         * (time between dawn and sunrise) does not vary by the time of year or location but purely depends on the time it
968         * takes to walk the distance of 4 mil.
969         * 
970         * @return the <code>Date</code> representing the time. If the calculation can't be computed such as in the Arctic
971         *         Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
972         *         a <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
973         *         documentation.
974         */
975        public Date getAlos90() {
976                return getTimeOffset(getElevationAdjustedSunrise(), -90 * MINUTE_MILLIS);
977        }
978
979        /**
980         * This method should be used <em>lechumra</em> only and returns <em>alos</em> (dawn) calculated using 120 minutes
981         * before {@link #getSeaLevelSunrise() sea level sunrise} (no adjustment for elevation is made) based on the time
982         * to walk the distance of 5 <a href="https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement"
983         * >mil</a> (<em>Ula</em>) at 24 minutes a mil. Time based offset calculations for <em>alos</em> are
984         * based on the* opinion of the <em><a href="https://en.wikipedia.org/wiki/Rishonim">Rishonim</a>
985         * </em> who stated that the time of the <em>neshef</em> (time between dawn and sunrise) does not vary by the time of
986         * year or location but purely depends on the time it takes to walk the distance of 5 mil (<em>Ula</em>). Since
987         * this time is extremely early, it should only be used <em>lechumra</em>, such as not eating after this time on a fast
988         * day, and not as the start time for <em>mitzvos</em> that can only be performed during the day.
989         * 
990         * @deprecated This method should be used <em>lechumra</em> only (such as stopping to eat at this time on a fast day),
991         *         since it returns a very early time, and if used <em>lekula</em> can result in doing <em>mitzvos hayom</em>
992         *         too early according to most opinions. There is no current plan to remove this method from the API, and this
993         *         deprecation is intended to alert developers of the danger of using it.
994         * 
995         * @return the <code>Date</code> representing the time. If the calculation can't be computed such as in the Arctic
996         *         Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
997         *         a <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
998         *         documentation.
999         * 
1000         * @see #getTzais120()
1001         * @see #getAlos26Degrees()
1002         */
1003        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
1004        public Date getAlos120() {
1005                return getTimeOffset(getElevationAdjustedSunrise(), -120 * MINUTE_MILLIS);
1006        }
1007
1008        /**
1009         * This method should be used <em>lechumra</em> only and  method returns <em>alos</em> (dawn) calculated using
1010         * 120 minutes <em>zmaniyos</em> or 1/6th of the day before {@link #getSunrise() sunrise} or {@link
1011         * #getSeaLevelSunrise() sea level sunrise} (depending on the {@link #isUseElevation()} setting). This is based
1012         * on a 24-minute <a href="https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a> so
1013         * the time for 5 mil is 120 minutes which is 1/6th of a day (12 * 60 / 6 = 120). The day is calculated
1014         * from {@link #getSeaLevelSunrise() sea level sunrise} to {@link #getSeaLevelSunset() sea level sunset} or
1015         * {@link #getSunrise() sunrise} to {@link #getSunset() sunset} (depending on the {@link #isUseElevation()}. The
1016         * actual calculation used is {@link #getSunrise()} - ({@link #getShaahZmanisGra()} * 2). Since this time is
1017         * extremely early, it should only be used <em>lechumra</em>, such
1018         * as not eating after this time on a fast day, and not as the start time for <em>mitzvos</em> that can only be
1019         * performed during the day.
1020         * 
1021         * @deprecated This method should be used <em>lechumra</em> only (such as stopping to eat at this time on a fast day),
1022         *         since it returns a very early time, and if used <em>lekula</em> can result in doing <em>mitzvos hayom</em>
1023         *         too early according to most opinions. There is no current plan to remove this method from the API, and this
1024         *         deprecation is intended to alert developers of the danger of using it.
1025         * 
1026         * @return the <code>Date</code> representing the time. If the calculation can't be computed such as in the Arctic
1027         *         Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
1028         *         a <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
1029         *         documentation.
1030         * @see #getAlos120()
1031         * @see #getAlos26Degrees()
1032         */
1033        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
1034        public Date getAlos120Zmanis() {
1035                return getZmanisBasedOffset(-2.0);
1036        }
1037
1038        /**
1039         * This method should be used <em>lechumra</em> only and returns <em>alos</em> (dawn) calculated when the sun is {@link
1040         * #ZENITH_26_DEGREES 26&deg;} below the eastern geometric horizon before sunrise. This calculation is based on the same
1041         * calculation of {@link #getAlos120() 120 minutes} but uses a degree-based calculation instead of 120 exact minutes. This
1042         * calculation is based on the position of the sun 120 minutes before sunrise in Jerusalem <a href=
1043         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a>, which
1044         * calculates to 26&deg; below {@link #GEOMETRIC_ZENITH geometric zenith}. Since this time is extremely early, it should
1045         * only be used <em>lechumra</em> only, such as not eating after this time on a fast day, and not as the start time for
1046         * <em>mitzvos</em> that can only be performed during the day.
1047         * 
1048         * @deprecated This method should be used <em>lechumra</em> only (such as stopping to eat at this time on a fast day),
1049         *         since it returns a very early time, and if used <em>lekula</em> can result in doing <em>mitzvos hayom</em>
1050         *         too early according to most opinions. There is no current plan to remove this  method from the API, and this
1051         *         deprecation is intended to alert developers of the danger of using it.
1052         * 
1053         * @return the <code>Date</code> representing <em>alos</em>. If the calculation can't be computed such as northern
1054         *         and southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun
1055         *         may not reach low enough below the horizon for this calculation, a <code>null</code> will be returned. See
1056         *         detailed explanation on top of the {@link AstronomicalCalendar} documentation.
1057         * @see #ZENITH_26_DEGREES
1058         * @see #getAlos120()
1059         * @see #getTzais120()
1060         * @see #getTzais26Degrees()
1061         */
1062        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
1063        public Date getAlos26Degrees() {
1064                return getSunriseOffsetByDegrees(ZENITH_26_DEGREES);
1065        }
1066
1067        /**
1068         * A method to return <em>alos</em> (dawn) calculated when the sun is {@link #ASTRONOMICAL_ZENITH 18&deg;} below the
1069         * eastern geometric horizon before sunrise.
1070         * 
1071         * @return the <code>Date</code> representing <em>alos</em>. If the calculation can't be computed such as northern
1072         *         and southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun
1073         *         may not reach low enough below the horizon for this calculation, a <code>null</code> will be returned.
1074         *         See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
1075         * @see #ASTRONOMICAL_ZENITH
1076         */
1077        public Date getAlos18Degrees() {
1078                return getSunriseOffsetByDegrees(ASTRONOMICAL_ZENITH);
1079        }
1080        
1081        /**
1082         * A method to return <em>alos</em> (dawn) calculated when the sun is {@link #ZENITH_19_DEGREES 19&deg;} below the
1083         * eastern geometric horizon before sunrise. This is the <a href="https://en.wikipedia.org/wiki/Maimonides"
1084         * >Rambam</a>'s <em>alos</em> according to Rabbi Moshe Kosower's <a href=
1085         * "https://www.worldcat.org/oclc/145454098">Maaglei Tzedek</a>, page 88, <a href=
1086         * "https://hebrewbooks.org/pdfpager.aspx?req=33464&pgnum=13">Ayeles Hashachar Vol. I, page 12</a>, <a href=
1087         * "https://hebrewbooks.org/pdfpager.aspx?req=55960&pgnum=258">Yom Valayla Shel Torah, Ch. 34, p. 222</a> and 
1088         * Rabbi Yaakov Shakow's <a href="https://www.worldcat.org/oclc/1043573513">Luach Ikvei Hayom</a>.
1089         * 
1090         * @return the <code>Date</code> representing <em>alos</em>. If the calculation can't be computed such as northern
1091         *         and southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun
1092         *         may not reach low enough below the horizon for this calculation, a <code>null</code> will be returned.
1093         *         See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
1094         * @see #ASTRONOMICAL_ZENITH
1095         */
1096        public Date getAlos19Degrees() {
1097                return getSunriseOffsetByDegrees(ZENITH_19_DEGREES);
1098        }
1099
1100        /**
1101         * Method to return <em>alos</em> (dawn) calculated when the sun is {@link #ZENITH_19_POINT_8 19.8&deg;} below the
1102         * eastern geometric horizon before sunrise. This calculation is based on the same calculation of
1103         * {@link #getAlos90() 90 minutes} but uses a degree-based calculation instead of 90 exact minutes. This calculation
1104         * is based on the position of the sun 90 minutes before sunrise in Jerusalem <a href=
1105         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a>, which
1106         * calculates to 19.8&deg; below {@link #GEOMETRIC_ZENITH geometric zenith}.
1107         * 
1108         * @return the <code>Date</code> representing <em>alos</em>. If the calculation can't be computed such as northern
1109         *         and southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun
1110         *         may not reach low enough below the horizon for this calculation, a <code>null</code> will be returned. See
1111         *         detailed explanation on top of the {@link AstronomicalCalendar} documentation.
1112         * @see #ZENITH_19_POINT_8
1113         * @see #getAlos90()
1114         */
1115        public Date getAlos19Point8Degrees() {
1116                return getSunriseOffsetByDegrees(ZENITH_19_POINT_8);
1117        }
1118
1119        /**
1120         * Method to return <em>alos</em> (dawn) calculated when the sun is {@link #ZENITH_16_POINT_1 16.1&deg;} below the
1121         * eastern geometric horizon before sunrise. This calculation is based on the same calculation of
1122         * {@link #getAlos72() 72 minutes} but uses a degree-based calculation instead of 72 exact minutes. This calculation
1123         * is based on the position of the sun 72 minutes before sunrise in Jerusalem <a href=
1124         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a>, which
1125         * calculates to 16.1&deg; below {@link #GEOMETRIC_ZENITH geometric zenith}.
1126         * 
1127         * @return the <code>Date</code> representing <em>alos</em>. If the calculation can't be computed such as northern
1128         *         and southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun
1129         *         may not reach low enough below the horizon for this calculation, a <code>null</code> will be returned. See
1130         *         detailed explanation on top of the {@link AstronomicalCalendar} documentation.
1131         * @see #ZENITH_16_POINT_1
1132         * @see #getAlos72()
1133         */
1134        public Date getAlos16Point1Degrees() {
1135                return getSunriseOffsetByDegrees(ZENITH_16_POINT_1);
1136        }
1137        
1138        /**
1139         * This method returns <em>misheyakir</em> based on the position of the sun {@link #ZENITH_12_POINT_85 12.85&deg;}
1140         * below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;) that is based on the position of the sun slightly
1141         * later than 57 minutes before {@link #getSunrise() sunrise} in Jerusalem <a href=
1142         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a>. This
1143         * <em>zman</em> is mentioned for use <b><em>bish'as hadchak</em></b> in the Birur Halacha <a href=
1144         * "https://hebrewbooks.org/pdfpager.aspx?req=50535&st=&pgnum=88">Tinyana</a> and <a href=
1145         * "https://hebrewbooks.org/pdfpager.aspx?req=50537&st=&pgnum=31">Tlisa'ah</a> in  Orach Chaim siman 18 as 12.85&deg;.
1146         * Actual calculations show it to be slightly more than 12.9&deg;, but the Birur Halacha indicates that 12.85&deg; is a
1147         * slight <em>chumra</em> (on a <em>bedieved</em> time) VS the 12.9&deg; that 57 minutes calculates as (a difference of
1148         * about 14 seconds at the equinox/equilux in Jerusalem). The <em>zman</em> of 12.9&deg; is also mentioned in the Piskei
1149         * Tshuvos siman 18, page 190 (where a typo indicates that this is the time for an 60 minutes before sunrise, when in fact
1150         * at that point the sun is about 13.5&deg; below the horizon).
1151         * Analysis of the difference between 12.85&deg; and 12.9&deg;, shows that the maximum difference occurs at the summer
1152         * solstice. In Lakewood, NJ at a latitude of 40.096&deg;, the maximum difference throughout the year between is 23 seconds.
1153         * In the winter where there is the greatest need for very early <em>misheyakir</em> times, the difference is in the 16
1154         * second range. Going north to Montreal at latitude 45.5&deg;, the maximum is 29 seconds and is about 18 seconds in the
1155         * winter. Moving farther north to the elevation of Vilnius at a latitude of 54.68&deg;, things change. Firstly, around the
1156         * summer solstice it will not reach that far below the horizon. On the dates that both can be calculated, the maximum
1157         * difference is 362 seconds (6 minutes and 2 seconds) on July 8. This is the extreme, and a one-day only occurrence. On the
1158         * previous day, Jul 7, the difference between 12.85&deg; and 12.9&deg; is "only" 2 minutes and 29 seconds. In Vilna, from
1159         * Dec - March, the difference is about 22 seconds.
1160         * 
1161         * @deprecated This method returns a very early <em>misheyakir</em> time that should only be used <b><em>bish'as
1162         *         hadchak</em></b>. <em>Lechatchila</em>, a later <em>zman</em> should be used. There is no current plan to remove
1163         *         this method from the API, and this deprecation is intended to notify developers to add an alert to users of
1164         *         the risk of using it.
1165         * 
1166         * @return the <code>Date</code> of <em>misheyakir</em>. If the calculation can't be computed such as northern and
1167         *         southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may
1168         *         not reach low enough below the horizon for this calculation, a <code>null</code> will be returned. See
1169         *         detailed explanation on top of the {@link AstronomicalCalendar} documentation.
1170         * @see #ZENITH_12_POINT_85
1171         */
1172        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
1173        public Date getMisheyakir12Point85Degrees() {
1174                return getSunriseOffsetByDegrees(ZENITH_12_POINT_85);
1175        }
1176
1177        /**
1178         * This method returns <em>misheyakir</em> based on the position of the sun when it is {@link #ZENITH_11_DEGREES
1179         * 11.5&deg;} below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is used for calculating
1180         * <em>misheyakir</em> according to some opinions. This calculation is based on the position of the sun 52 minutes
1181         * before {@link #getSunrise() sunrise} in Jerusalem <a href=
1182         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a>,
1183         * which calculates to 11.5&deg; below {@link #GEOMETRIC_ZENITH geometric zenith}.
1184         * @todo recalculate.
1185         * 
1186         * @return the <code>Date</code> of <em>misheyakir</em>. If the calculation can't be computed such as northern and
1187         *         southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may
1188         *         not reach low enough below the horizon for this calculation, a <code>null</code> will be returned. See
1189         *         detailed explanation on top of the {@link AstronomicalCalendar} documentation.
1190         * @see #ZENITH_11_POINT_5
1191         */
1192        public Date getMisheyakir11Point5Degrees() {
1193                return getSunriseOffsetByDegrees(ZENITH_11_POINT_5);
1194        }
1195
1196        /**
1197         * This method returns <em>misheyakir</em> based on the position of the sun when it is {@link #ZENITH_11_DEGREES
1198         * 11&deg;} below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is used for calculating
1199         * <em>misheyakir</em> according to some opinions. This calculation is based on the position of the sun 48 minutes
1200         * before {@link #getSunrise() sunrise} in Jerusalem <a href=
1201         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a>,
1202         * which calculates to 11&deg; below {@link #GEOMETRIC_ZENITH geometric zenith}.
1203         * 
1204         * @return If the calculation can't be computed such as northern and southern locations even south of the Arctic
1205         *         Circle and north of the Antarctic Circle where the sun may not reach low enough below the horizon for
1206         *         this calculation, a <code>null</code> will be returned. See detailed explanation on top of the
1207         *         {@link AstronomicalCalendar} documentation.
1208         * @see #ZENITH_11_DEGREES
1209         */
1210        public Date getMisheyakir11Degrees() {
1211                return getSunriseOffsetByDegrees(ZENITH_11_DEGREES);
1212        }
1213
1214        /**
1215         * This method returns <em>misheyakir</em> based on the position of the sun when it is {@link #ZENITH_10_POINT_2
1216         * 10.2&deg;} below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is used for calculating
1217         * <em>misheyakir</em> according to some opinions. This calculation is based on the position of the sun 45 minutes
1218         * before {@link #getSunrise() sunrise} in Jerusalem <a href=
1219         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox</a> which calculates
1220         * to 10.2&deg; below {@link #GEOMETRIC_ZENITH geometric zenith}.
1221         * 
1222         * @return the <code>Date</code> of <em>misheyakir</em>. If the calculation can't be computed such as
1223         *         northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle where
1224         *         the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be returned
1225         *         See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
1226         * @see #ZENITH_10_POINT_2
1227         */
1228        public Date getMisheyakir10Point2Degrees() {
1229                return getSunriseOffsetByDegrees(ZENITH_10_POINT_2);
1230        }
1231        
1232        /**
1233         * This method returns <em>misheyakir</em> based on the position of the sun when it is {@link #ZENITH_7_POINT_65
1234         * 7.65&deg;} below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). The degrees are based on a 35/36 minute
1235         * <em>zman</em> <a href="https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the
1236         * equinox / equilux</a>, when the <em>neshef</em> (twilight) is the shortest. This time is based on <a href=
1237         * "https://en.wikipedia.org/wiki/Moshe_Feinstein">Rabbi Moshe Feinstein</a> who writes in <a href=
1238         * "https://hebrewbooks.org/pdfpager.aspx?req=14677&pgnum=7">Ohr Hachaim Vol. 4, Ch. 6</a>
1239         * that <em>misheyakir</em> in New York is 35-40 minutes before sunrise, something that is a drop less than 8&deg;.
1240         * <a href="https://en.wikipedia.org/wiki/Yisroel_Taplin">Rabbi Yisroel Taplin</a> in <a href=
1241         * "https://www.worldcat.org/oclc/889556744">Zmanei Yisrael</a> (page 117) notes that <a href=
1242         * "https://en.wikipedia.org/wiki/Yaakov_Kamenetsky">Rabbi Yaakov Kamenetsky</a> stated that it is not less than 36
1243         * minutes before sunrise (maybe it is 40 minutes). Sefer Yisrael Vehazmanim (p. 7) quotes the Tamar Yifrach
1244         * in the name of the <a href="https://en.wikipedia.org/wiki/Joel_Teitelbaum">Satmar Rov</a> that one should be stringent
1245         * not consider <em>misheyakir</em> before 36 minutes. This is also the accepted <a href=
1246         * "https://en.wikipedia.org/wiki/Minhag">minhag</a> in <a href=
1247         * "https://en.wikipedia.org/wiki/Lakewood_Township,_New_Jersey">Lakewood</a> that is used in the <a href=
1248         * "https://en.wikipedia.org/wiki/Beth_Medrash_Govoha">Yeshiva</a>. This follows the opinion of <a href=
1249         * "https://en.wikipedia.org/wiki/Shmuel_Kamenetsky">Rabbi Shmuel Kamenetsky</a> who provided the time of 35/36 minutes,
1250         * but did not provide a degree-based time. Since this <em>zman</em> depends on the level of light, Rabbi Yaakov Shakow
1251         * presented this degree-based calculations to Rabbi Shmuel Kamenetsky who agreed to them.
1252         * 
1253         * @return the <code>Date</code> of <em>misheyakir</em>. If the calculation can't be computed such as
1254         *         northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle where
1255         *         the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be returned.
1256         *         See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
1257         * 
1258         * @see #ZENITH_7_POINT_65
1259         * @see #getMisheyakir9Point5Degrees()
1260         */
1261        public Date getMisheyakir7Point65Degrees() {
1262                return getSunriseOffsetByDegrees(ZENITH_7_POINT_65);
1263        }
1264        
1265        /**
1266         * This method returns <em>misheyakir</em> based on the position of the sun when it is {@link #ZENITH_9_POINT_5
1267         * 9.5&deg;} below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is based on <a href=
1268         * "https://en.wikipedia.org/wiki/Dovid_Kronglas">Rabbi Dovid Kronglass's</a> Calculation of 45 minutes in Baltimore
1269         * as mentioned in <a href="https://hebrewbooks.org/pdfpager.aspx?req=20287&pgnum=29">Divrei Chachamim No. 24</a>
1270         * brought down by the <a href="https://hebrewbooks.org/pdfpager.aspx?req=50535&pgnum=87">Birur Halacha, Tinyana, Ch.
1271         * 18</a>. This calculates to 9.5&deg;. Also see <a href="https://en.wikipedia.org/wiki/Jacob_Isaac_Neiman">Rabbi Yaakov
1272         * Yitzchok Neiman</a> in Kovetz Eitz Chaim Vol. 9, p. 202 that the Vya'an Yosef did not want to rely on times earlier
1273         * than 45 minutes in New York. This <em>zman</em> is also used in the calendars published by Rabbi Hershel Edelstein.
1274         * As mentioned in Yisroel Vehazmanim, Rabbi Edelstein who was given the 45 minute <em>zman</em> by Rabbi Bick. The
1275         * calendars published by the <em><a href="https://en.wikipedia.org/wiki/Mizrahi_Jews">Edot Hamizrach</a></em> communities
1276         * also use this <em>zman</em>. This also follows the opinion of <a href="https://en.wikipedia.org/wiki/Shmuel_Kamenetsky"
1277         * >Rabbi Shmuel Kamenetsky</a> who provided the time of 36 and 45 minutes, but did not provide a degree-based time. Since
1278         * this <em>zman</em> depends on the level of light, Rabbi Yaakov Shakow presented these degree-based times to Rabbi Shmuel
1279         * Kamenetsky who agreed to them.
1280         * 
1281         * @return the <code>Date</code> of <em>misheyakir</em>. If the calculation can't be computed such as
1282         *         northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle where
1283         *         the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be returned.
1284         *         See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
1285         * 
1286         * @see #ZENITH_9_POINT_5
1287         * @see #getMisheyakir7Point65Degrees()
1288         */
1289        public Date getMisheyakir9Point5Degrees() {
1290                return getSunriseOffsetByDegrees(ZENITH_9_POINT_5);
1291        }
1292
1293        /**
1294         * This method returns the latest <em>zman krias shema</em> (time to recite Shema in the morning) according to the
1295         * opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on
1296         * <em>alos</em> being {@link #getAlos19Point8Degrees() 19.8&deg;} before {@link #getSunrise() sunrise}. This
1297         * time is 3 {@link #getShaahZmanis19Point8Degrees() <em>shaos zmaniyos</em>} (solar hours) after {@link
1298         * #getAlos19Point8Degrees() dawn} based on the opinion of the MGA that the day is calculated from dawn to nightfall
1299         * with both being 19.8&deg; below sunrise or sunset. This returns the time of 3 *
1300         * {@link #getShaahZmanis19Point8Degrees()} after {@link #getAlos19Point8Degrees() dawn}.
1301         * 
1302         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1303         *         as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
1304         *         where the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be
1305         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
1306         * @see #getShaahZmanis19Point8Degrees()
1307         * @see #getAlos19Point8Degrees()
1308         */
1309        public Date getSofZmanShmaMGA19Point8Degrees() {
1310                return getSofZmanShma(getAlos19Point8Degrees(), getTzais19Point8Degrees(), true);
1311        }
1312
1313        /**
1314         * This method returns the latest <em>zman krias shema</em> (time to recite Shema in the morning) according to the
1315         * opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based
1316         * on <em>alos</em> being {@link #getAlos16Point1Degrees() 16.1&deg;} before {@link #getSunrise() sunrise}. This time
1317         * is 3 {@link #getShaahZmanis16Point1Degrees() <em>shaos zmaniyos</em>} (solar hours) after
1318         * {@link #getAlos16Point1Degrees() dawn} based on the opinion of the MGA that the day is calculated from
1319         * dawn to nightfall with both being 16.1&deg; below sunrise or sunset. This returns the time of
1320         * 3 * {@link #getShaahZmanis16Point1Degrees()} after {@link #getAlos16Point1Degrees() dawn}.
1321         * 
1322         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1323         *         as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
1324         *         where the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be
1325         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
1326         * @see #getShaahZmanis16Point1Degrees()
1327         * @see #getAlos16Point1Degrees()
1328         */
1329        public Date getSofZmanShmaMGA16Point1Degrees() {
1330                return getSofZmanShma(getAlos16Point1Degrees(), getTzais16Point1Degrees(), true);
1331        }
1332
1333        /**
1334         * This method returns the latest <em>zman krias shema</em> (time to recite Shema in the morning) according to the
1335         * opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based
1336         * on <em>alos</em> being {@link #getAlos18Degrees() 18&deg;} before {@link #getSunrise() sunrise}. This time is 3
1337         * {@link #getShaahZmanis18Degrees() <em>shaos zmaniyos</em>} (solar hours) after {@link #getAlos18Degrees() dawn}
1338         * based on the opinion of the MGA that the day is calculated from dawn to nightfall with both being 18&deg;
1339         * below sunrise or sunset. This returns the time of 3 * {@link #getShaahZmanis18Degrees()} after
1340         * {@link #getAlos18Degrees() dawn}.
1341         * 
1342         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1343         *         as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
1344         *         where the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be
1345         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
1346         * @see #getShaahZmanis18Degrees()
1347         * @see #getAlos18Degrees()
1348         */
1349        public Date getSofZmanShmaMGA18Degrees() {
1350                return getSofZmanShma(getAlos18Degrees(), getTzais18Degrees(), true);
1351        }
1352
1353        /**
1354         * This method returns the latest <em>zman krias shema</em> (time to recite Shema in the morning) according to the
1355         * opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on
1356         * <em>alos</em> being {@link #getAlos72() 72} minutes before {@link #getSunrise() sunrise}. This time is 3 {@link
1357         * #getShaahZmanis72Minutes() <em>shaos zmaniyos</em>} (solar hours) after {@link #getAlos72() dawn} based on the opinion
1358         * of the MGA that the day is calculated from a {@link #getAlos72() dawn} of 72 minutes before sunrise to
1359         * {@link #getTzais72() nightfall} of 72 minutes after sunset. This returns the time of 3 * {@link
1360         * #getShaahZmanis72Minutes()} after {@link #getAlos72() dawn}. This class returns an identical time to {@link
1361         * #getSofZmanShmaMGA()} and is repeated here for clarity.
1362         * 
1363         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1364         *         as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
1365         *         it does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1366         *         {@link AstronomicalCalendar} documentation.
1367         * @see #isUseAstronomicalChatzosForOtherZmanim()
1368         * @see #getShaahZmanis72Minutes()
1369         * @see #getAlos72()
1370         * @see #getSofZmanShmaMGA()
1371         */
1372        public Date getSofZmanShmaMGA72Minutes() {
1373                return getSofZmanShmaMGA();
1374        }
1375
1376        /**
1377         * This method returns the latest <em>zman krias shema</em> (time to recite <em>Shema</em> in the morning) according
1378         * to the opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based
1379         * on <em>alos</em> being {@link #getAlos72Zmanis() 72} minutes <em>zmaniyos</em>, or 1/10th of the day before
1380         * {@link #getSunrise() sunrise}. This time is 3 {@link #getShaahZmanis90MinutesZmanis() <em>shaos zmaniyos</em>}
1381         * (solar hours) after {@link #getAlos72Zmanis() dawn} based on the opinion of the MGA that the day is calculated
1382         * from a {@link #getAlos72Zmanis() dawn} of 72 minutes <em>zmaniyos</em>, or 1/10th of the day before
1383         * {@link #getSeaLevelSunrise() sea level sunrise} to {@link #getTzais72Zmanis() nightfall} of 72 minutes
1384         * <em>zmaniyos</em> after {@link #getSeaLevelSunset() sea level sunset}. This returns the time of 3 *
1385         * {@link #getShaahZmanis72MinutesZmanis()} after {@link #getAlos72Zmanis() dawn}.
1386         * 
1387         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1388         *         as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
1389         *         it does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1390         *         {@link AstronomicalCalendar} documentation.
1391         * @see #getShaahZmanis72MinutesZmanis()
1392         * @see #getAlos72Zmanis()
1393         * @see #isUseAstronomicalChatzosForOtherZmanim()
1394         */
1395        public Date getSofZmanShmaMGA72MinutesZmanis() {
1396                return getSofZmanShma(getAlos72Zmanis(), getTzais72Zmanis(), true);
1397        }
1398
1399        /**
1400         * This method returns the latest <em>zman krias shema</em> (time to recite <em>Shema</em> in the morning) according
1401         * to the opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on
1402         * <em>alos</em> being {@link #getAlos90() 90} minutes before {@link #getSunrise() sunrise}. This time is 3
1403         * {@link #getShaahZmanis90Minutes() <em>shaos zmaniyos</em>} (solar hours) after {@link #getAlos90() dawn} based on
1404         * the opinion of the MGA that the day is calculated from a {@link #getAlos90() dawn} of 90 minutes before sunrise to
1405         * {@link #getTzais90() nightfall} of 90 minutes after sunset. This returns the time of 3 *
1406         * {@link #getShaahZmanis90Minutes()} after {@link #getAlos90() dawn}.
1407         * 
1408         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1409         *         as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
1410         *         it does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1411         *         {@link AstronomicalCalendar} documentation.
1412         * @see #getShaahZmanis90Minutes()
1413         * @see #getAlos90()
1414         * @see #isUseAstronomicalChatzosForOtherZmanim()
1415         */
1416        public Date getSofZmanShmaMGA90Minutes() {
1417                return getSofZmanShma(getAlos90(), getTzais90(), true);
1418        }
1419
1420        /**
1421         * This method returns the latest <em>zman krias shema</em> (time to recite Shema in the morning) according to the
1422         * opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based
1423         * on <em>alos</em> being {@link #getAlos90Zmanis() 90} minutes <em>zmaniyos</em> before {@link #getSunrise()
1424         * sunrise}. This time is 3 {@link #getShaahZmanis90MinutesZmanis() <em>shaos zmaniyos</em>} (solar hours) after
1425         * {@link #getAlos90Zmanis() dawn} based on the opinion of the MGA that the day is calculated from a {@link
1426         * #getAlos90Zmanis() dawn} of 90 minutes <em>zmaniyos</em> before sunrise to {@link #getTzais90Zmanis() nightfall}
1427         * of 90 minutes <em>zmaniyos</em> after sunset. This returns the time of 3 * {@link #getShaahZmanis90MinutesZmanis()}
1428         * after {@link #getAlos90Zmanis() dawn}.
1429         * 
1430         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1431         *         as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
1432         *         it does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1433         *         {@link AstronomicalCalendar} documentation.
1434         * @see #getShaahZmanis90MinutesZmanis()
1435         * @see #getAlos90Zmanis()
1436         * @see #isUseAstronomicalChatzosForOtherZmanim()
1437         */
1438        public Date getSofZmanShmaMGA90MinutesZmanis() {
1439                return getSofZmanShma(getAlos90Zmanis(), getTzais90Zmanis(), true);
1440        }
1441
1442        /**
1443         * This method returns the latest <em>zman krias shema</em> (time to recite Shema in the morning) according to the
1444         * opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based
1445         * on <em>alos</em> being {@link #getAlos96() 96} minutes before {@link #getSunrise() sunrise}. This time is 3
1446         * {@link #getShaahZmanis96Minutes() <em>shaos zmaniyos</em>} (solar hours) after {@link #getAlos96() dawn} based on
1447         * the opinion of the MGA that the day is calculated from a {@link #getAlos96() dawn} of 96 minutes before
1448         * sunrise to {@link #getTzais96() nightfall} of 96 minutes after sunset. This returns the time of 3 * {@link
1449         * #getShaahZmanis96Minutes()} after {@link #getAlos96() dawn}.
1450         * 
1451         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1452         *         as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
1453         *         it does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1454         *         {@link AstronomicalCalendar} documentation.
1455         * @see #getShaahZmanis96Minutes()
1456         * @see #getAlos96()
1457         * @see #isUseAstronomicalChatzosForOtherZmanim()
1458         */
1459        public Date getSofZmanShmaMGA96Minutes() {
1460                return getSofZmanShma(getAlos96(), getTzais96(), true);
1461        }
1462
1463        /**
1464         * This method returns the latest <em>zman krias shema</em> (time to recite Shema in the morning) according to the
1465         * opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based
1466         * on <em>alos</em> being {@link #getAlos90Zmanis() 96} minutes <em>zmaniyos</em> before {@link #getSunrise()
1467         * sunrise}. This time is 3 {@link #getShaahZmanis96MinutesZmanis() <em>shaos zmaniyos</em>} (solar hours) after
1468         * {@link #getAlos96Zmanis() dawn} based on the opinion of the MGA that the day is calculated from a {@link
1469         * #getAlos96Zmanis() dawn} of 96 minutes <em>zmaniyos</em> before sunrise to {@link #getTzais90Zmanis() nightfall}
1470         * of 96 minutes <em>zmaniyos</em> after sunset. This returns the time of 3 * {@link #getShaahZmanis96MinutesZmanis()}
1471         * after {@link #getAlos96Zmanis() dawn}.
1472         * 
1473         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1474         *         as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
1475         *         it does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1476         *         {@link AstronomicalCalendar} documentation.
1477         * @see #getShaahZmanis96MinutesZmanis()
1478         * @see #getAlos96Zmanis()
1479         * @see #isUseAstronomicalChatzosForOtherZmanim()
1480         */
1481        public Date getSofZmanShmaMGA96MinutesZmanis() {
1482                return getSofZmanShma(getAlos96Zmanis(), getTzais96Zmanis(), true);
1483        }
1484
1485        /**
1486         * This method returns the latest <em>zman krias shema</em> (time to recite <em>Shema</em> in the morning) calculated
1487         * as 3 hours (regular clock hours and not <em>shaos zmaniyos</em>) before {@link ZmanimCalendar#getChatzos()}.
1488         * Generally known as part of the "Komarno" <em>zmanim</em> after <a href=
1489         * "https://en.wikipedia.org/wiki/Komarno_(Hasidic_dynasty)#Rabbi_Yitzchak_Eisik_Safrin">Rav Yitzchak Eizik of
1490         * Komarno</a>, a proponent of this calculation, it actually predates him a lot. It is the opinion of the 
1491         * <em>Shach</em> in the Nekudas Hakesef (Yoreh Deah 184), <a href=
1492         * "https://hebrewbooks.org/pdfpager.aspx?req=21638&st=&pgnum=30">Rav Moshe Lifshitz</a> in his commentary
1493         * <a href="https://hebrewbooks.org/pdfpager.aspx?req=21638&st=&pgnum=50">Lechem Mishneh on Brachos 1:2</a>. It is
1494         * next brought down about 100 years later by the <a href="https://en.wikipedia.org/wiki/Jacob_Emden">Yaavetz</a>
1495         * (in his <em>siddur</em>, <a href="https://hebrewbooks.org/pdfpager.aspx?req=7920&st=&pgnum=6">Mor Uktziah Orach
1496         * Chaim 1</a>, <a href="https://hebrewbooks.org/pdfpager.aspx?req=22309&st=&pgnum=30">Lechem Shamayim, Brachos 1:2</a>
1497         * and <a href="https://hebrewbooks.org/pdfpager.aspx?req=1408&st=&pgnum=69">She'elos Yaavetz vol. 1 no. 40</a>),
1498         * Rav Yitzchak Eizik of Komarno in the Ma'aseh Oreg on Mishnayos Brachos 11:2, Shevus Yaakov, Chasan Sofer and others.
1499         * See Yisrael Vehazmanim <a href="https://hebrewbooks.org/pdfpager.aspx?req=9765&st=&pgnum=83">vol. 1 7:3, page 55 -
1500         * 62</a>. A variant of this calculation {@link #getSofZmanShmaFixedLocal()} uses {@link #getFixedLocalChatzos() fixed
1501         * local <em>chatzos</em>} for calculating this type of <em>zman</em>.
1502         * 
1503         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1504         *         as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
1505         *         it does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1506         *         {@link AstronomicalCalendar} documentation.
1507         * @see ZmanimCalendar#getChatzos()
1508         * @see #getSofZmanShmaFixedLocal()
1509         * @see #getSofZmanTfila2HoursBeforeChatzos()
1510         * @see #isUseAstronomicalChatzos()
1511         */
1512        public Date getSofZmanShma3HoursBeforeChatzos() {
1513                return getTimeOffset(getChatzos(), -180 * MINUTE_MILLIS);
1514        }
1515
1516        /**
1517         * This method returns the latest <em>zman krias shema</em> (time to recite Shema in the morning) according to the
1518         * opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based
1519         * on <em>alos</em> being {@link #getAlos120() 120} minutes or 1/6th of the day before {@link #getSunrise() sunrise}.
1520         * This time is 3 {@link #getShaahZmanis120Minutes() <em>shaos zmaniyos</em>} (solar hours) after {@link #getAlos120()
1521         * dawn} based on the opinion of the MGA that the day is calculated from a {@link #getAlos120() dawn} of 120 minutes
1522         * before sunrise to {@link #getTzais120() nightfall} of 120 minutes after sunset. This returns the time of 3
1523         * {@link #getShaahZmanis120Minutes()} after {@link #getAlos120() dawn}. This is an extremely early <em>zman</em> that
1524         * is very much a <em>chumra</em>.
1525         * 
1526         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1527         *         as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
1528         *         it does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1529         *         {@link AstronomicalCalendar} documentation.
1530         * @see #getShaahZmanis120Minutes()
1531         * @see #getAlos120()
1532         * @see #isUseAstronomicalChatzosForOtherZmanim()
1533         */
1534        public Date getSofZmanShmaMGA120Minutes() {
1535                return getSofZmanShma(getAlos120(), getTzais120(), true);
1536        }
1537
1538        /**
1539         * This method returns the latest <em>zman krias shema</em> (time to recite <em>Shema</em> in the morning) based
1540         * on the opinion that the day starts at {@link #getAlos16Point1Degrees() <em>alos</em> 16.1&deg;} and ends at
1541         * {@link #getSeaLevelSunset() sea level sunset}. This is the opinion of the <a href=
1542         * "https://hebrewbooks.org/40357">\u05D7\u05D9\u05D3\u05D5\u05E9\u05D9
1543         * \u05D5\u05DB\u05DC\u05DC\u05D5\u05EA \u05D4\u05E8\u05D6\u05F4\u05D4</a> and the <a href=
1544         * "https://hebrewbooks.org/14799">\u05DE\u05E0\u05D5\u05E8\u05D4 \u05D4\u05D8\u05D4\u05D5\u05E8\u05D4</a> as
1545         * mentioned by Yisrael Vehazmanim <a href="https://hebrewbooks.org/pdfpager.aspx?req=9765&pgnum=81">vol 1, sec. 7,
1546         * ch. 3 no. 16</a>. Three <em>shaos zmaniyos</em> are calculated based on this day and added to {@link
1547         * #getAlos16Point1Degrees() <em>alos</em>} to reach this time. This time is 3 <em>shaos zmaniyos</em> (solar hours)
1548         * after {@link #getAlos16Point1Degrees() dawn} based on the opinion that the day is calculated from a {@link
1549         * #getAlos16Point1Degrees() <em>alos</em> 16.1&deg;} to {@link #getSeaLevelSunset() sea level sunset}.
1550         * <b>Note: </b> Based on this calculation <em>chatzos</em> will not be at midday and {@link
1551         * #isUseAstronomicalChatzosForOtherZmanim()} will be ignored.
1552         * 
1553         * @return the <code>Date</code> of the latest <em>zman krias shema</em> based on this day. If the calculation can't
1554         *         be computed such as northern and southern locations even south of the Arctic Circle and north of the
1555         *         Antarctic Circle where the sun may not reach low enough below the horizon for this calculation, a null
1556         *         will be returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
1557         * @see #getAlos16Point1Degrees()
1558         * @see #getSeaLevelSunset()
1559         */
1560        public Date getSofZmanShmaAlos16Point1ToSunset() {
1561                return getSofZmanShma(getAlos16Point1Degrees(), getElevationAdjustedSunset(), false);
1562        }
1563
1564        /**
1565         * This method returns the latest <em>zman krias shema</em> (time to recite Shema in the morning) based on the
1566         * opinion that the day starts at {@link #getAlos16Point1Degrees() <em>alos</em> 16.1&deg;} and ends at
1567         * {@link #getTzaisGeonim7Point083Degrees() <em>tzais</em> 7.083&deg;}. 3 <em>shaos zmaniyos</em> are calculated
1568         * based on this day and added to {@link #getAlos16Point1Degrees() <em>alos</em>} to reach this time. This time is 3
1569         * <em>shaos zmaniyos</em> (temporal hours) after {@link #getAlos16Point1Degrees() <em>alos</em> 16.1&deg;} based on
1570         * the opinion that the day is calculated from a {@link #getAlos16Point1Degrees() <em>alos</em> 16.1&deg;} to
1571         * {@link #getTzaisGeonim7Point083Degrees() <em>tzais</em> 7.083&deg;}.
1572         * <b>Note: </b> Based on this calculation <em>chatzos</em> will not be at midday and {@link
1573         * #isUseAstronomicalChatzosForOtherZmanim()} will be ignored.
1574         * 
1575         * @return the <code>Date</code> of the latest <em>zman krias shema</em> based on this calculation. If the
1576         *         calculation can't be computed such as northern and southern locations even south of the Arctic Circle and
1577         *         north of the Antarctic Circle where the sun may not reach low enough below the horizon for this
1578         *         calculation, a <code>null</code> will be returned. See detailed explanation on top of the
1579         *         {@link AstronomicalCalendar} documentation.
1580         * @see #getAlos16Point1Degrees()
1581         * @see #getTzaisGeonim7Point083Degrees()
1582         */
1583        public Date getSofZmanShmaAlos16Point1ToTzaisGeonim7Point083Degrees() {
1584                return getSofZmanShma(getAlos16Point1Degrees(), getTzaisGeonim7Point083Degrees(), false);
1585        }
1586
1587        /**
1588         * From the GRA in Kol Eliyahu on Berachos #173 that states that <em>zman krias shema</em> is calculated as half the
1589         * time from {@link #getSeaLevelSunrise() sea level sunrise} to {@link #getFixedLocalChatzos() fixed local chatzos}.
1590         * The GRA himself seems to contradict this when he stated that <em>zman krias shema</em> is 1/4 of the day from
1591         * sunrise to sunset. See <em>Sarah Lamoed</em> #25 in Yisroel Vehazmanim Vol. III page 1016.
1592         * 
1593         * @return the <code>Date</code> of the latest <em>zman krias shema</em> based on this calculation. If the
1594         *         calculation can't be computed such as in the Arctic Circle where there is at least one day a year where
1595         *         the sun does not rise, and one where it does not set, a <code>null</code> will be returned. See detailed
1596         *         explanation on top of the {@link AstronomicalCalendar} documentation.
1597         * @see #getFixedLocalChatzos()
1598         * 
1599         * @deprecated As per a conversation Rabbi Yisroel Twerski had with Rabbi Harfenes, this <em>zman</em> published in
1600         *         the Yisrael Vehazmanim was based on a misunderstanding and should not be used. This deprecated method
1601         *         will be removed (likely in v3.0) pending confirmation from Rabbi Harfenes.
1602         */
1603        @Deprecated // (since="1.3", forRemoval=true) // add back once Java 9 is the minimum supported version
1604        public Date getSofZmanShmaKolEliyahu() {
1605                Date chatzos = getFixedLocalChatzos();
1606                if (chatzos == null || getSunrise() == null) {
1607                        return null;
1608                }
1609                long diff = (chatzos.getTime() - getElevationAdjustedSunrise().getTime()) / 2;
1610                return getTimeOffset(chatzos, -diff);
1611        }
1612
1613        /**
1614         * This method returns the latest <em>zman tfila</em> (time to recite the morning prayers) according to the opinion
1615         * of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on
1616         * <em>alos</em> being {@link #getAlos19Point8Degrees() 19.8&deg;} before {@link #getSunrise() sunrise}. This time
1617         * is 4 {@link #getShaahZmanis19Point8Degrees() <em>shaos zmaniyos</em>} (solar hours) after {@link
1618         * #getAlos19Point8Degrees() dawn} based on the opinion of the MGA that the day is calculated from dawn to
1619         * nightfall with both being 19.8&deg; below sunrise or sunset. This returns the time of 4 * {@link
1620         * #getShaahZmanis19Point8Degrees()} after {@link #getAlos19Point8Degrees() dawn}.
1621         * 
1622         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1623         *         as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
1624         *         where the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be
1625         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
1626         * 
1627         * @see #getShaahZmanis19Point8Degrees()
1628         * @see #getAlos19Point8Degrees()
1629         * @see #isUseAstronomicalChatzosForOtherZmanim()
1630         */
1631        public Date getSofZmanTfilaMGA19Point8Degrees() {
1632                return getSofZmanTfila(getAlos19Point8Degrees(), getTzais19Point8Degrees(), true);
1633        }
1634
1635        /**
1636         * This method returns the latest <em>zman tfila</em> (time to recite the morning prayers) according to the opinion
1637         * of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on
1638         * <em>alos</em> being {@link #getAlos16Point1Degrees() 16.1&deg;} before {@link #getSunrise() sunrise}. This time
1639         * is 4 {@link #getShaahZmanis16Point1Degrees() <em>shaos zmaniyos</em>} (solar hours) after {@link
1640         * #getAlos16Point1Degrees() dawn} based on the opinion of the MGA that the day is calculated from dawn to
1641         * nightfall with both being 16.1&deg; below sunrise or sunset. This returns the time of 4 * {@link
1642         * #getShaahZmanis16Point1Degrees()} after {@link #getAlos16Point1Degrees() dawn}.
1643         * 
1644         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1645         *         as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
1646         *         where the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be
1647         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
1648         * 
1649         * @see #getShaahZmanis16Point1Degrees()
1650         * @see #getAlos16Point1Degrees()
1651         */
1652        public Date getSofZmanTfilaMGA16Point1Degrees() {
1653                return getSofZmanTfila(getAlos16Point1Degrees(), getTzais16Point1Degrees(), true);
1654        }
1655
1656        /**
1657         * This method returns the latest <em>zman tfila</em> (time to recite the morning prayers) according to the opinion
1658         * of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on
1659         * <em>alos</em> being {@link #getAlos18Degrees() 18&deg;} before {@link #getSunrise() sunrise}. This time is 4
1660         * {@link #getShaahZmanis18Degrees() <em>shaos zmaniyos</em>} (solar hours) after {@link #getAlos18Degrees() dawn}
1661         * based on the opinion of the MGA that the day is calculated from dawn to nightfall with both being 18&deg;
1662         * below sunrise or sunset. This returns the time of 4 * {@link #getShaahZmanis18Degrees()} after
1663         * {@link #getAlos18Degrees() dawn}.
1664         * 
1665         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1666         *         as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
1667         *         where the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be
1668         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
1669         * 
1670         * @see #getShaahZmanis18Degrees()
1671         * @see #getAlos18Degrees()
1672         */
1673        public Date getSofZmanTfilaMGA18Degrees() {
1674                return getSofZmanTfila(getAlos18Degrees(), getTzais18Degrees(), true);
1675        }
1676
1677        /**
1678         * This method returns the latest <em>zman tfila</em> (time to recite the morning prayers) according to the opinion
1679         * of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on
1680         * <em>alos</em> being {@link #getAlos72() 72} minutes before {@link #getSunrise() sunrise}. This time is 4
1681         * {@link #getShaahZmanis72Minutes() <em>shaos zmaniyos</em>} (solar hours) after {@link #getAlos72() dawn} based on
1682         * the opinion of the MGA that the day is calculated from a {@link #getAlos72() dawn} of 72 minutes before
1683         * sunrise to {@link #getTzais72() nightfall} of 72 minutes after sunset. This returns the time of 4 *
1684         * {@link #getShaahZmanis72Minutes()} after {@link #getAlos72() dawn}. This class returns an identical time to
1685         * {@link #getSofZmanTfilaMGA()} and is repeated here for clarity.
1686         * 
1687         * @return the <code>Date</code> of the latest <em>zman tfila</em>. If the calculation can't be computed such as in
1688         *         the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
1689         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1690         *         {@link AstronomicalCalendar} documentation.
1691         * @see #getShaahZmanis72Minutes()
1692         * @see #getAlos72()
1693         * @see #getSofZmanShmaMGA()
1694         */
1695        public Date getSofZmanTfilaMGA72Minutes() {
1696                return getSofZmanTfilaMGA();
1697        }
1698
1699        /**
1700         * This method returns the latest <em>zman tfila</em> (time to the morning prayers) according to the opinion of the
1701         * <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on <em>alos</em>
1702         * being {@link #getAlos72Zmanis() 72} minutes <em>zmaniyos</em> before {@link #getSunrise() sunrise}. This time is 4
1703         * {@link #getShaahZmanis72MinutesZmanis() <em>shaos zmaniyos</em>} (solar hours) after {@link #getAlos72Zmanis() dawn}
1704         * based on the opinion of the MGA that the day is calculated from a {@link #getAlos72Zmanis() dawn} of 72
1705         * minutes <em>zmaniyos</em> before sunrise to {@link #getTzais72Zmanis() nightfall} of 72 minutes <em>zmaniyos</em>
1706         * after sunset. This returns the time of 4 * {@link #getShaahZmanis72MinutesZmanis()} after {@link #getAlos72Zmanis() dawn}.
1707         * 
1708         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1709         *         as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
1710         *         it does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1711         *         {@link AstronomicalCalendar} documentation.
1712         * @see #getShaahZmanis72MinutesZmanis()
1713         * @see #getAlos72Zmanis()
1714         */
1715        public Date getSofZmanTfilaMGA72MinutesZmanis() {
1716                return getSofZmanTfila(getAlos72Zmanis(), getTzais72Zmanis(), true);
1717        }
1718
1719        /**
1720         * This method returns the latest <em>zman tfila</em> (time to recite the morning prayers) according to the opinion
1721         * of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on
1722         * <em>alos</em> being {@link #getAlos90() 90} minutes before {@link #getSunrise() sunrise}. This time is 4
1723         * {@link #getShaahZmanis90Minutes() <em>shaos zmaniyos</em>} (solar hours) after {@link #getAlos90() dawn} based on
1724         * the opinion of the MGA that the day is calculated from a {@link #getAlos90() dawn} of 90 minutes before sunrise to
1725         * {@link #getTzais90() nightfall} of 90 minutes after sunset. This returns the time of 4 *
1726         * {@link #getShaahZmanis90Minutes()} after {@link #getAlos90() dawn}.
1727         * 
1728         * @return the <code>Date</code> of the latest <em>zman tfila</em>. If the calculation can't be computed such as in
1729         *         the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
1730         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1731         *         {@link AstronomicalCalendar} documentation.
1732         * @see #getShaahZmanis90Minutes()
1733         * @see #getAlos90()
1734         */
1735        public Date getSofZmanTfilaMGA90Minutes() {
1736                return getSofZmanTfila(getAlos90(), getTzais90(), true);
1737        }
1738
1739        /**
1740         * This method returns the latest <em>zman tfila</em> (time to the morning prayers) according to the opinion of the
1741         * <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on <em>alos</em>
1742         * being {@link #getAlos90Zmanis() 90} minutes <em>zmaniyos</em> before {@link #getSunrise() sunrise}. This time is
1743         * 4 {@link #getShaahZmanis90MinutesZmanis() <em>shaos zmaniyos</em>} (solar hours) after {@link #getAlos90Zmanis()
1744         * dawn} based on the opinion of the MGA that the day is calculated from a {@link #getAlos90Zmanis() dawn}
1745         * of 90 minutes <em>zmaniyos</em> before sunrise to {@link #getTzais90Zmanis() nightfall} of 90 minutes
1746         * <em>zmaniyos</em> after sunset. This returns the time of 4 * {@link #getShaahZmanis90MinutesZmanis()} after
1747         * {@link #getAlos90Zmanis() dawn}.
1748         * 
1749         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1750         *         as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
1751         *         it does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1752         *         {@link AstronomicalCalendar} documentation.
1753         * @see #getShaahZmanis90MinutesZmanis()
1754         * @see #getAlos90Zmanis()
1755         */
1756        public Date getSofZmanTfilaMGA90MinutesZmanis() {
1757                return getSofZmanTfila(getAlos90Zmanis(), getTzais90Zmanis(), true);
1758        }
1759
1760        /**
1761         * This method returns the latest <em>zman tfila</em> (time to recite the morning prayers) according to the opinion
1762         * of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on
1763         * <em>alos</em> being {@link #getAlos96() 96} minutes before {@link #getSunrise() sunrise}. This time is 4
1764         * {@link #getShaahZmanis96Minutes() <em>shaos zmaniyos</em>} (solar hours) after {@link #getAlos96() dawn} based on
1765         * the opinion of the MGA that the day is calculated from a {@link #getAlos96() dawn} of 96 minutes before
1766         * sunrise to {@link #getTzais96() nightfall} of 96 minutes after sunset. This returns the time of 4 *
1767         * {@link #getShaahZmanis96Minutes()} after {@link #getAlos96() dawn}.
1768         * 
1769         * @return the <code>Date</code> of the latest <em>zman tfila</em>. If the calculation can't be computed such as in
1770         *         the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
1771         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1772         *         {@link AstronomicalCalendar} documentation.
1773         * @see #getShaahZmanis96Minutes()
1774         * @see #getAlos96()
1775         */
1776        public Date getSofZmanTfilaMGA96Minutes() {
1777                return getSofZmanTfila(getAlos96(), getTzais96(), true);
1778        }
1779
1780        /**
1781         * This method returns the latest <em>zman tfila</em> (time to the morning prayers) according to the opinion of the
1782         * <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on <em>alos</em>
1783         * being {@link #getAlos96Zmanis() 96} minutes <em>zmaniyos</em> before {@link #getSunrise() sunrise}. This time is
1784         * 4 {@link #getShaahZmanis96MinutesZmanis() <em>shaos zmaniyos</em>} (solar hours) after {@link #getAlos96Zmanis()
1785         * dawn} based on the opinion of the MGA that the day is calculated from a {@link #getAlos96Zmanis() dawn}
1786         * of 96 minutes <em>zmaniyos</em> before sunrise to {@link #getTzais96Zmanis() nightfall} of 96 minutes
1787         * <em>zmaniyos</em> after sunset. This returns the time of 4 * {@link #getShaahZmanis96MinutesZmanis()} after
1788         * {@link #getAlos96Zmanis() dawn}.
1789         * 
1790         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1791         *         as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
1792         *         it does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1793         *         {@link AstronomicalCalendar} documentation.
1794         * @see #getShaahZmanis90MinutesZmanis()
1795         * @see #getAlos90Zmanis()
1796         */
1797        public Date getSofZmanTfilaMGA96MinutesZmanis() {
1798                return getSofZmanTfila(getAlos96Zmanis(), getTzais96Zmanis(), true);
1799        }
1800
1801        /**
1802         * This method returns the latest <em>zman tfila</em> (time to recite the morning prayers) according to the opinion
1803         * of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on
1804         * <em>alos</em> being {@link #getAlos120() 120} minutes before {@link #getSunrise() sunrise} . This time is 4
1805         * {@link #getShaahZmanis120Minutes() <em>shaos zmaniyos</em>} (solar hours) after {@link #getAlos120() dawn}
1806         * based on the opinion of the MGA that the day is calculated from a {@link #getAlos120() dawn} of 120
1807         * minutes before sunrise to {@link #getTzais120() nightfall} of 120 minutes after sunset. This returns the time of
1808         * 4 * {@link #getShaahZmanis120Minutes()} after {@link #getAlos120() dawn}. This is an extremely early <em>zman</em>
1809         * that is very much a <em>chumra</em>.
1810         * 
1811         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1812         *         as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
1813         *         it does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1814         *         {@link AstronomicalCalendar} documentation.
1815         * @see #getShaahZmanis120Minutes()
1816         * @see #getAlos120()
1817         */
1818        public Date getSofZmanTfilaMGA120Minutes() {
1819                return getSofZmanTfila(getAlos120(), getTzais120(), true);
1820        }
1821
1822        /**
1823         * This method returns the latest <em>zman tfila</em> (time to recite the morning prayers) calculated as 2 hours
1824         * before {@link ZmanimCalendar#getChatzos()}. This is based on the opinions that calculate
1825         * <em>sof zman krias shema</em> as {@link #getSofZmanShma3HoursBeforeChatzos()}. This returns the time of 2 hours
1826         * before {@link ZmanimCalendar#getChatzos()}.
1827         * 
1828         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1829         *         as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
1830         *         it does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1831         *         {@link AstronomicalCalendar} documentation.
1832         * @see ZmanimCalendar#getChatzos()
1833         * @see #getSofZmanShma3HoursBeforeChatzos()
1834         */
1835        public Date getSofZmanTfila2HoursBeforeChatzos() {
1836                return getTimeOffset(getChatzos(), -120 * MINUTE_MILLIS);
1837        }
1838
1839        /**
1840         * This method returns <em>mincha gedola</em> calculated as 30 minutes after {@link #getChatzos() <em>chatzos</em>}
1841         * and not 1/2 of a {@link #getShaahZmanisGra() <em>shaah zmanis</em>} after {@link #getChatzos() <em>chatzos</em>} as
1842         * calculated by {@link #getMinchaGedola}. Some use this time to delay the start of <em>mincha</em> in the winter when
1843         * 1/2 of a {@link #getShaahZmanisGra() <em>shaah zmanis</em>} is less than 30 minutes. See
1844         * {@link #getMinchaGedolaGreaterThan30()} for a convenience method that returns the later of the 2 calculations. One
1845         * should not use this time to start <em>mincha</em> before the standard {@link #getMinchaGedola() <em>mincha gedola</em>}.
1846         * See Shulchan Aruch <a href="https://hebrewbooks.org/pdfpager.aspx?req=49624&st=&pgnum=291">Orach Chayim 234:1</a> and
1847         * the Shaar Hatziyon <em>seif katan ches</em>. Since this calculation is a fixed 30 minutes of regular clock time after
1848         * <em>chatzos</em>, even if {@link #isUseAstronomicalChatzosForOtherZmanim()} is <code>false</code>, this <em>mincha
1849         * gedola</em> time will be affected by {@link #isUseAstronomicalChatzos()} and not by
1850         * {@link #isUseAstronomicalChatzosForOtherZmanim()}.
1851         * 
1852         * @return the <code>Date</code> of 30 minutes after <em>chatzos</em>. If the calculation can't be computed such as
1853         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
1854         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1855         *         {@link AstronomicalCalendar} documentation.
1856         * @see #getMinchaGedola()
1857         * @see #getMinchaGedolaGreaterThan30()
1858         * @see #getChatzos()
1859         * @see #isUseAstronomicalChatzos()
1860         * @see #isUseAstronomicalChatzosForOtherZmanim()
1861         */
1862        public Date getMinchaGedola30Minutes() {
1863                return getTimeOffset(getChatzos(), MINUTE_MILLIS * 30);
1864        }
1865
1866        /**
1867         * This method returns the time of <em>mincha gedola</em> according to the Magen Avraham with the day starting 72
1868         * minutes before sunrise and ending 72 minutes after sunset. This is the earliest time to pray <em>mincha</em>. For
1869         * more information on this see the documentation on {@link #getMinchaGedola() <em>mincha gedola</em>}. This is
1870         * calculated as 6.5 {@link #getTemporalHour() solar hours} after <em>alos</em>. The calculation used is 6.5 *
1871         * {@link #getShaahZmanis72Minutes()} after {@link #getAlos72() <em>alos</em>}. If {@link
1872         * #isUseAstronomicalChatzosForOtherZmanim()} is set to <code>true</code>, the calculation will be based on 0.5
1873         * {@link #getHalfDayBasedShaahZmanis(Date, Date) half-day based <em>sha'ah zmanis</em>} between {@link #getChatzos()}
1874         * and {@link #getTzais72()} after {@link #getChatzos()}.
1875         * 
1876         * @see #getAlos72()
1877         * @see #getMinchaGedola()
1878         * @see #getMinchaKetana()
1879         * @see ZmanimCalendar#getMinchaGedola()
1880         * @see #getChatzos()
1881         * @see #isUseAstronomicalChatzosForOtherZmanim()
1882         * @return the <code>Date</code> of the time of <em>mincha gedola</em>. If the calculation can't be computed such as
1883         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
1884         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1885         *         {@link AstronomicalCalendar} documentation.
1886         */
1887        public Date getMinchaGedola72Minutes() {
1888                if (isUseAstronomicalChatzosForOtherZmanim()) {
1889                        return getHalfDayBasedZman(getChatzos(), getTzais72(), 0.5);
1890                } else {
1891                        return getMinchaGedola(getAlos72(), getTzais72(), true);
1892                }
1893        }
1894
1895        /**
1896         * This method returns the time of <em>mincha gedola</em> according to the Magen Avraham with the day starting and
1897         * ending 16.1&deg; below the horizon. This is the earliest time to pray <em>mincha</em>. For more information on
1898         * this see the documentation on {@link #getMinchaGedola() <em>mincha gedola</em>}. This is calculated as 6.5
1899         * {@link #getTemporalHour() solar hours} after <em>alos</em>. The calculation used is 6.5 *
1900         * {@link #getShaahZmanis16Point1Degrees()} after {@link #getAlos16Point1Degrees() <em>alos</em>}. If {@link
1901         * #isUseAstronomicalChatzosForOtherZmanim()} is set to <code>true</code>, the calculation will be based on 0.5
1902         * {@link #getHalfDayBasedShaahZmanis(Date, Date) half-day based <em>sha'ah zmanis</em>} between {@link #getChatzos()}
1903         * and {@link #getAlos16Point1Degrees()} after {@link #getChatzos()}.
1904         * @see #getShaahZmanis16Point1Degrees()
1905         * @see #getMinchaGedola()
1906         * @see #getMinchaKetana()
1907         * @return the <code>Date</code> of the time of <em>mincha gedola</em>. If the calculation can't be computed such as
1908         *         northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle where
1909         *         the sun  may not reach low enough below the horizon for this calculation, a <code>null</code> will be returned.
1910         *         See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
1911         */
1912        public Date getMinchaGedola16Point1Degrees() {
1913                if (isUseAstronomicalChatzosForOtherZmanim()) {
1914                        return getHalfDayBasedZman(getChatzos(), getTzais16Point1Degrees(), 0.5);
1915                } else {
1916                        return getMinchaGedola(getAlos16Point1Degrees(), getTzais16Point1Degrees(), true);
1917                }
1918                
1919        }
1920        
1921        /**
1922         * This method returns the time of <em>mincha gedola</em> based on the opinion of <a href=
1923         * "https://en.wikipedia.org/wiki/Yaakov_Moshe_Hillel">Rabbi Yaakov Moshe Hillel</a> as published in the <em>luach</em>
1924         * of the Bais Horaah of Yeshivat Chevrat Ahavat Shalom that <em>mincha gedola</em> is calculated as half a <em>shaah
1925         * zmanis</em> after <em>chatzos</em> with <em>shaos zmaniyos</em> calculated based on a day starting 72 minutes before sunrise
1926         * {@link #getAlos16Point1Degrees() <em>alos</em> 16.1&deg;} and ending 13.5 minutes after sunset {@link
1927         * #getTzaisGeonim3Point7Degrees() <em>tzais</em> 3.7&deg;}. <em>Mincha gedola</em> is the earliest time to pray <em>mincha</em>.
1928         * The later of this time or 30 clock minutes after <em>chatzos</em> is returned. See {@link #getMinchaGedolaGreaterThan30()}
1929         * (though that calculation is based on <em>mincha gedola</em> GRA).
1930         * For more information about <em>mincha gedola</em> see the documentation on {@link #getMinchaGedola() <em>mincha gedola</em>}.
1931         * Since calculation of this <em>zman</em> involves <em>chatzos</em> that is offset from the center of the astronomical day,
1932         * {@link #isUseAstronomicalChatzosForOtherZmanim()} is N/A here.
1933         * @return the <code>Date</code> of the <em>mincha gedola</em>. If the calculation can't be computed such as northern and
1934         *         southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may not
1935         *         reach low enough below the horizon for this calculation, a <code>null</code> will be returned. See detailed
1936         *         explanation on top of the {@link AstronomicalCalendar} documentation.
1937         * 
1938         * @see #getAlos16Point1Degrees()
1939         * @see #getTzaisGeonim3Point7Degrees()
1940         * @see #getShaahZmanisAlos16Point1ToTzais3Point7()
1941         * @see #getMinchaGedolaGreaterThan30()
1942         */
1943        public Date getMinchaGedolaAhavatShalom() {
1944                if (getChatzos() == null || getMinchaGedola30Minutes() == null || getShaahZmanisAlos16Point1ToTzais3Point7() == Long.MIN_VALUE) {
1945                        return null;
1946                } else {
1947                        return getMinchaGedola30Minutes().compareTo(getTimeOffset(getChatzos(), getShaahZmanisAlos16Point1ToTzais3Point7() / 2)) > 0 ?
1948                                        getMinchaGedola30Minutes() : getTimeOffset(getChatzos(), getShaahZmanisAlos16Point1ToTzais3Point7() / 2);
1949                }
1950        }
1951
1952        /**
1953         * FIXME check for synchronous
1954         * This is a convenience method that returns the later of {@link #getMinchaGedola()} and
1955         * {@link #getMinchaGedola30Minutes()}. In the winter when 1/2 of a {@link #getShaahZmanisGra() <em>shaah zmanis</em>} is
1956         * less than 30 minutes {@link #getMinchaGedola30Minutes()} will be returned, otherwise {@link #getMinchaGedola()}
1957         * will be returned. Since this calculation can be an offset of <em>chatzos</em> (if 30 clock minutes > 1/2 of a <em>shaah
1958         * zmanis</em>), even if {@link #isUseAstronomicalChatzosForOtherZmanim()} is <code>false</code>, this <em>mincha</em> time
1959         * may be affected by {@link #isUseAstronomicalChatzos()}.
1960         * 
1961         * @return the <code>Date</code> of the later of {@link #getMinchaGedola()} and {@link #getMinchaGedola30Minutes()}.
1962         *         If the calculation can't be computed such as in the Arctic Circle where there is at least one day a year
1963         *         where the sun does not rise, and one where it does not set, a <code>null</code> will be returned. See detailed
1964         *         explanation on top of the {@link AstronomicalCalendar} documentation.
1965         * @see #getMinchaGedola()
1966         * @see #getMinchaGedola30Minutes()
1967         * @see #isUseAstronomicalChatzos()
1968         * 
1969         */
1970        public Date getMinchaGedolaGreaterThan30() {
1971                if (getMinchaGedola30Minutes() == null || getMinchaGedola() == null) {
1972                        return null;
1973                } else {
1974                        return getMinchaGedola30Minutes().compareTo(getMinchaGedola()) > 0 ? getMinchaGedola30Minutes()
1975                                        : getMinchaGedola();
1976                }
1977        }
1978
1979        /**
1980         * This method returns the time of <em>mincha ketana</em> according to the Magen Avraham with the day starting and
1981         * ending 16.1&deg; below the horizon. This is the preferred earliest time to pray <em>mincha</em> according to the
1982         * opinion of the <a href="https://en.wikipedia.org/wiki/Maimonides">Rambam</a> and others. For more information on
1983         * this see the documentation on {@link #getMinchaGedola() <em>mincha gedola</em>}. This is calculated as 9.5
1984         * {@link #getTemporalHour() solar hours} after <em>alos</em>. The calculation used is 9.5 *
1985         * {@link #getShaahZmanis16Point1Degrees()} after {@link #getAlos16Point1Degrees() <em>alos</em>}.
1986         * 
1987         * @see #getShaahZmanis16Point1Degrees()
1988         * @see #getMinchaGedola()
1989         * @see #getMinchaKetana()
1990         * @return the <code>Date</code> of the time of <em>mincha ketana</em>. If the calculation can't be computed such
1991         *         as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
1992         *         where the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be
1993         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
1994         */
1995        public Date getMinchaKetana16Point1Degrees() {
1996                return getMinchaKetana(getAlos16Point1Degrees(), getTzais16Point1Degrees(), true);
1997        }
1998        
1999        /**
2000         * This method returns the time of <em>mincha ketana</em> based on the opinion of <a href=
2001         * "https://en.wikipedia.org/wiki/Yaakov_Moshe_Hillel">Rabbi Yaakov Moshe Hillel</a> as published in the <em>luach</em>
2002         * of the Bais Horaah of Yeshivat Chevrat Ahavat Shalom that <em>mincha ketana</em> is calculated as 2.5 <em>shaos
2003         * zmaniyos</em> before {@link #getTzaisGeonim3Point8Degrees() <em>tzais</em> 3.8&deg;} with <em>shaos zmaniyos</em>
2004         * calculated based on a day starting at {@link #getAlos16Point1Degrees() <em>alos</em> 16.1&deg;} and ending at
2005         * <em>tzais</em> 3.8&deg;. <em>Mincha ketana</em> is the preferred earliest time to pray <em>mincha</em> according to
2006         * the opinion of the <a href="https://en.wikipedia.org/wiki/Maimonides">Rambam</a> and others. For more information
2007         * on this see the documentation on {@link #getMinchaKetana() <em>mincha ketana</em>}.
2008         * 
2009         * @return the <code>Date</code> of the time of <em>mincha ketana</em>. If the calculation can't be computed such as
2010         *         northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle where the
2011         *         sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be returned.
2012         *         See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
2013         * 
2014         * @see #getShaahZmanisAlos16Point1ToTzais3Point8()
2015         * @see #getMinchaGedolaAhavatShalom()
2016         * @see #getPlagAhavatShalom()
2017         */
2018        public Date getMinchaKetanaAhavatShalom() {
2019                return getTimeOffset(getTzaisGeonim3Point8Degrees(), -getShaahZmanisAlos16Point1ToTzais3Point8() * 2.5);
2020        }
2021
2022        /**
2023         * This method returns the time of <em>mincha ketana</em> according to the Magen Avraham with the day
2024         * starting 72 minutes before sunrise and ending 72 minutes after sunset. This is the preferred earliest time to pray
2025         * <em>mincha</em> according to the opinion of the <a href="https://en.wikipedia.org/wiki/Maimonides">Rambam</a>
2026         * and others. For more information on this see the documentation on {@link #getMinchaGedola() <em>mincha gedola</em>}.
2027         * This is calculated as 9.5 {@link #getShaahZmanis72Minutes()} after <em>alos</em>. The calculation used is 9.5 *
2028         * {@link #getShaahZmanis72Minutes()} after {@link #getAlos72() <em>alos</em>}.
2029         * 
2030         * @see #getShaahZmanis16Point1Degrees()
2031         * @see #getMinchaGedola()
2032         * @see #getMinchaKetana()
2033         * @return the <code>Date</code> of the time of <em>mincha ketana</em>. If the calculation can't be computed such as
2034         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
2035         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
2036         *         {@link AstronomicalCalendar} documentation.
2037         */
2038        public Date getMinchaKetana72Minutes() {
2039                return getMinchaKetana(getAlos72(), getTzais72(), true);
2040        }
2041
2042        /**
2043         * This method returns the time of <em>plag hamincha</em> according to the Magen Avraham with the day starting 60
2044         * minutes before sunrise and ending 60 minutes after sunset. This is calculated as 10.75 hours after
2045         * {@link #getAlos60() dawn}. The formula used is 10.75 {@link #getShaahZmanis60Minutes()} after {@link #getAlos60()}.
2046         * 
2047         * @return the <code>Date</code> of the time of <em>plag hamincha</em>. If the calculation can't be computed such as
2048         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
2049         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
2050         *         {@link AstronomicalCalendar} documentation.
2051         * 
2052         * @see #getShaahZmanis60Minutes()
2053         * @see #getAlos60()
2054         * @see #getTzais60()
2055         */
2056        public Date getPlagHamincha60Minutes() {
2057                return getPlagHamincha(getAlos60(), getTzais60(), true);
2058        }
2059
2060        /**
2061         * This method should be used <em>lechumra</em> only and returns the time of <em>plag hamincha</em> according to the
2062         * Magen Avraham with the day starting 72 minutes before sunrise and ending 72 minutes after sunset. This is calculated
2063         * as 10.75 hours after {@link #getAlos72() dawn}. The formula used is 10.75 {@link #getShaahZmanis72Minutes()} after
2064         * {@link #getAlos72()}. Since <em>plag</em> by this calculation can occur after sunset, it should only be used
2065         * <em>lechumra</em>.
2066         * 
2067         * @deprecated This method should be used <em>lechumra</em> only since it returns a very late time (often after
2068         *         <em>shkiah</em>), and if used <em>lekula</em> can result in <em>chillul Shabbos</em> etc. There is no
2069         *         current plan to remove this method from the API, and this deprecation is intended to alert developers
2070         *         of the danger of using it.
2071         * 
2072         * @return the <code>Date</code> of the time of <em>plag hamincha</em>. If the calculation can't be computed such as
2073         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
2074         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
2075         *         {@link AstronomicalCalendar} documentation.
2076         * 
2077         * @see #getShaahZmanis72Minutes()
2078         */
2079        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
2080        public Date getPlagHamincha72Minutes() {
2081                return getPlagHamincha(getAlos72(), getTzais72(), true);
2082        }
2083
2084        /**
2085         * This method should be used <em>lechumra</em> only and returns the time of <em>plag hamincha</em> according to the
2086         * Magen Avraham with the day starting 90 minutes before sunrise and ending 90 minutes after sunset. This is calculated
2087         * as 10.75 hours after {@link #getAlos90() dawn}. The formula used is 10.75 {@link #getShaahZmanis90Minutes()} after
2088         * {@link #getAlos90()}. Since <em>plag</em> by this calculation can occur after sunset, it should only be used
2089         * <em>lechumra</em>.
2090         * 
2091         * @deprecated This method should be used <em>lechumra</em> only since it returns a very late time (often after
2092         *         <em>shkiah</em>), and if used <em>lekula</em> can result in <em>chillul Shabbos</em> etc. There is no
2093         *         current plan to remove this method from the API, and this deprecation is intended to alert developers
2094         *         of the danger of using it.
2095         * 
2096         * @return the <code>Date</code> of the time of <em>plag hamincha</em>. If the calculation can't be computed such as
2097         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
2098         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
2099         *         {@link AstronomicalCalendar} documentation.
2100         * 
2101         * @see #getShaahZmanis90Minutes()
2102         */
2103        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
2104        public Date getPlagHamincha90Minutes() {
2105                return getPlagHamincha(getAlos90(), getTzais90(), true);
2106        }
2107
2108        /**
2109         * This method should be used <em>lechumra</em> only and returns the time of <em>plag hamincha</em> according to the Magen
2110         * Avraham with the day starting 96 minutes before sunrise and ending 96 minutes after sunset. This is calculated as 10.75
2111         * hours after {@link #getAlos96() dawn}. The formula used is 10.75 {@link #getShaahZmanis96Minutes()} after
2112         * {@link #getAlos96()}. Since <em>plag</em> by this calculation can occur after sunset, it should only be used
2113         * <em>lechumra</em>.
2114         * 
2115         * @deprecated This method should be used <em>lechumra</em> only since it returns a very late time (often after
2116         *         <em>shkiah</em>), and if used <em>lekula</em> can result in <em>chillul Shabbos</em> etc. There is no
2117         *         current plan to remove this method from the API, and this deprecation is intended to alert developers
2118         *         of the danger of using it.
2119         * 
2120         * @return the <code>Date</code> of the time of <em>plag hamincha</em>. If the calculation can't be computed such as
2121         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
2122         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
2123         *         {@link AstronomicalCalendar} documentation.
2124         * @see #getShaahZmanis96Minutes()
2125         */
2126        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
2127        public Date getPlagHamincha96Minutes() {
2128                return getPlagHamincha(getAlos96(), getTzais96(), true);
2129        }
2130
2131        /**
2132         * This method should be used <em>lechumra</em> only and returns the time of <em>plag hamincha</em>. This is calculated
2133         * as 10.75 hours after {@link #getAlos96Zmanis() dawn}. The formula used is 10.75 * {@link
2134         * #getShaahZmanis96MinutesZmanis()} after {@link #getAlos96Zmanis() dawn}. Since <em>plag</em> by this calculation can
2135         * occur after sunset, it should only be used <em>lechumra</em>.
2136         * 
2137         * @deprecated This method should be used <em>lechumra</em> only since it returns a very late time (often after
2138         *         <em>shkiah</em>), and if used <em>lekula</em> can result in <em>chillul Shabbos</em> etc. There is no
2139         *         current plan to remove this method from the API, and this deprecation is intended to alert developers
2140         *         of the danger of using it.
2141         * 
2142         * @return the <code>Date</code> of the time of <em>plag hamincha</em>. If the calculation can't be computed such as
2143         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
2144         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
2145         *         {@link AstronomicalCalendar} documentation.
2146         */
2147        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
2148        public Date getPlagHamincha96MinutesZmanis() {
2149                return getPlagHamincha(getAlos96Zmanis(), getTzais96Zmanis(), true);
2150        }
2151
2152        /**
2153         * This method should be used <em>lechumra</em> only and returns the time of <em>plag hamincha</em>. This is calculated
2154         * as 10.75 hours after {@link #getAlos90Zmanis() dawn}. The formula used is 10.75 * {@link
2155         * #getShaahZmanis90MinutesZmanis()} after {@link #getAlos90Zmanis() dawn}. Since <em>plag</em> by this calculation can
2156         * occur after sunset, it should only be used <em>lechumra</em>.
2157         * 
2158         * @deprecated This method should be used <em>lechumra</em> only since it returns a very late time (often after
2159         *         <em>shkiah</em>), and if used <em>lekula</em> can result in <em>chillul Shabbos</em> etc. There is no
2160         *         current plan to remove this method from the API, and this deprecation is intended to alert developers
2161         *         of the danger of using it.
2162         * 
2163         * @return the <code>Date</code> of the time of <em>plag hamincha</em>. If the calculation can't be computed such as
2164         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
2165         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
2166         *         {@link AstronomicalCalendar} documentation.
2167         */
2168        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
2169        public Date getPlagHamincha90MinutesZmanis() {
2170                return getPlagHamincha(getAlos90Zmanis(), getTzais90Zmanis(), true);
2171        }
2172
2173        /**
2174         * This method should be used <em>lechumra</em> only and returns the time of <em>plag hamincha</em>. This is calculated as
2175         * 10.75 hours after {@link #getAlos72Zmanis()}. The formula used is 10.75 * {@link #getShaahZmanis72MinutesZmanis()} after
2176         * {@link #getAlos72Zmanis() dawn}. Since <em>plag</em> by this calculation can occur after sunset, it should only be used
2177         * <em>lechumra</em>.
2178         * 
2179         * @deprecated This method should be used <em>lechumra</em> only since it returns a very late time (often after
2180         *         <em>shkiah</em>), and if used <em>lekula</em> can result in <em>chillul Shabbos</em> etc. There is no
2181         *         current plan to remove this method from the API, and this deprecation is intended to alert developers
2182         *         of the danger of using it.
2183         * 
2184         * @return the <code>Date</code> of the time of <em>plag hamincha</em>. If the calculation can't be computed such as
2185         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
2186         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
2187         *         {@link AstronomicalCalendar} documentation.
2188         */
2189        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
2190        public Date getPlagHamincha72MinutesZmanis() {
2191                return getPlagHamincha(getAlos72Zmanis(), getTzais72Zmanis(), true);
2192        }
2193
2194        /**
2195         * This method should be used <em>lechumra</em> only and returns the time of <em>plag hamincha</em> based on the
2196         * opinion that the day starts at {@link #getAlos16Point1Degrees() <em>alos</em> 16.1&deg;} and ends at {@link
2197         * #getTzais16Point1Degrees() <em>tzais</em> 16.1&deg;}. This is calculated as 10.75 hours <em>zmaniyos</em>
2198         * after {@link #getAlos16Point1Degrees() dawn}. The formula used is 10.75 * {@link #getShaahZmanis16Point1Degrees()}
2199         * after {@link #getAlos16Point1Degrees()}. Since <em>plag</em> by this calculation can occur after sunset, it
2200         * should only be used <em>lechumra</em>.
2201         * 
2202         * @deprecated This method should be used <em>lechumra</em> only since it returns a very late time (often after
2203         *         <em>shkiah</em>), and if used <em>lekula</em> can result in <em>chillul Shabbos</em> etc. There is no
2204         *         current plan to remove this method from the API, and this deprecation is intended to alert developers
2205         *         of the danger of using it.
2206         * 
2207         * @return the <code>Date</code> of the time of <em>plag hamincha</em>. If the calculation can't be computed such as
2208         *         northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle where
2209         *         the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be
2210         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
2211         * 
2212         * @see #getShaahZmanis16Point1Degrees()
2213         */
2214        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
2215        public Date getPlagHamincha16Point1Degrees() {
2216                return getPlagHamincha(getAlos16Point1Degrees(), getTzais16Point1Degrees(), true);
2217        }
2218
2219        /**
2220         * This method should be used <em>lechumra</em> only and returns the time of <em>plag hamincha</em> based on the
2221         * opinion that the day starts at {@link #getAlos19Point8Degrees() <em>alos</em> 19.8&deg;} and ends at {@link
2222         * #getTzais19Point8Degrees() <em>tzais</em> 19.8&deg;}. This is calculated as 10.75 hours <em>zmaniyos</em>
2223         * after {@link #getAlos19Point8Degrees() dawn}. The formula used is 10.75 * {@link
2224         * #getShaahZmanis19Point8Degrees()} after {@link #getAlos19Point8Degrees()}. Since <em>plag</em> by this
2225         * calculation can occur after sunset, it should only be used <em>lechumra</em>.
2226         * 
2227         * @deprecated This method should be used <em>lechumra</em> only since it returns a very late time (often after
2228         *         <em>shkiah</em>), and if used <em>lekula</em> can result in <em>chillul Shabbos</em> etc. There is no
2229         *         current plan to remove this method from the API, and this deprecation is intended to alert developers
2230         *         of the danger of using it.
2231         * 
2232         * @return the <code>Date</code> of the time of <em>plag hamincha</em>. If the calculation can't be computed such as
2233         *         northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle where
2234         *         the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be
2235         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
2236         * 
2237         * @see #getShaahZmanis19Point8Degrees()
2238         */
2239        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
2240        public Date getPlagHamincha19Point8Degrees() {
2241                return getPlagHamincha(getAlos19Point8Degrees(), getTzais19Point8Degrees(), true);
2242        }
2243
2244        /**
2245         * This method should be used <em>lechumra</em> only and returns the time of <em>plag hamincha</em> based on the
2246         * opinion that the day starts at {@link #getAlos26Degrees() <em>alos</em> 26&deg;} and ends at {@link
2247         * #getTzais26Degrees() <em>tzais</em> 26&deg;}. This is calculated as 10.75 hours <em>zmaniyos</em> after {@link
2248         * #getAlos26Degrees() dawn}. The formula used is 10.75 * {@link #getShaahZmanis26Degrees()} after {@link
2249         * #getAlos26Degrees()}. Since the <em>zman</em> based on an extremely early <em>alos</em> and a very late
2250         * <em>tzais</em>, it should only be used <em>lechumra</em>.
2251         * 
2252         * @deprecated This method should be used <em>lechumra</em> only since it returns a very late time (often after
2253         *         <em>shkiah</em>), and if used <em>lekula</em> can result in <em>chillul Shabbos</em> etc. There is no
2254         *         current plan to remove this method from the API, and this deprecation is intended to alert developers
2255         *         of the danger of using it.
2256         * 
2257         * @return the <code>Date</code> of the time of <em>plag hamincha</em>. If the calculation can't be computed such as
2258         *         northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle where
2259         *         the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be
2260         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
2261         * 
2262         * @see #getShaahZmanis26Degrees()
2263         * @see #getPlagHamincha120Minutes()
2264         */
2265        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
2266        public Date getPlagHamincha26Degrees() {
2267                return getPlagHamincha(getAlos26Degrees(), getTzais26Degrees(), true);
2268        }
2269
2270        /**
2271         * This method should be used <em>lechumra</em> only and returns the time of <em>plag hamincha</em> based on the
2272         * opinion that the day starts at {@link #getAlos18Degrees() <em>alos</em> 18&deg;} and ends at {@link
2273         * #getTzais18Degrees() <em>tzais</em> 18&deg;}. This is calculated as 10.75 hours <em>zmaniyos</em> after {@link
2274         * #getAlos18Degrees() dawn}. The formula used is 10.75 * {@link #getShaahZmanis18Degrees()} after {@link
2275         * #getAlos18Degrees()}. Since <em>plag</em> by this calculation can occur after sunset, it should only be used
2276         * <em>lechumra</em>.
2277         * 
2278         * @deprecated This method should be used <em>lechumra</em> only since it returns a very late time (often after
2279         *         <em>shkiah</em>), and if used <em>lekula</em> can result in <em>chillul Shabbos</em> etc. There is no
2280         *         current plan to remove this method from the API, and this deprecation is intended to alert developers
2281         *         of the danger of using it.
2282         * 
2283         * @return the <code>Date</code> of the time of <em>plag hamincha</em>. If the calculation can't be computed such as
2284         *         northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle where
2285         *         the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be
2286         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
2287         * 
2288         * @see #getShaahZmanis18Degrees()
2289         */
2290        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
2291        public Date getPlagHamincha18Degrees() {
2292                return getPlagHamincha(getAlos18Degrees(), getTzais18Degrees(), true);
2293        }
2294
2295        /**
2296         * This method should be used <em>lechumra</em> only and returns the time of <em>plag hamincha</em> based on the opinion
2297         * that the day starts at {@link #getAlos16Point1Degrees() <em>alos</em> 16.1&deg;} and ends at {@link #getSunset() sunset}.
2298         * 10.75 <em>shaos zmaniyos</em> are calculated based on this day and added to {@link #getAlos16Point1Degrees()
2299         * <em>alos</em>} to reach this time. This time is 10.75 <em>shaos zmaniyos</em> (temporal hours) after {@link
2300         * #getAlos16Point1Degrees() dawn} based on the opinion that the day is calculated from a {@link #getAlos16Point1Degrees()
2301         * dawn} of 16.1 degrees before sunrise to {@link #getSeaLevelSunset() sea level sunset}. This returns the time of 10.75 *
2302         * the calculated <em>shaah zmanis</em> after {@link #getAlos16Point1Degrees() dawn}. Since <em>plag</em> by this
2303         * calculation can occur after sunset, it should only be used <em>lechumra</em>.
2304         * 
2305         * 
2306         * @return the <code>Date</code> of the <em>plag</em>. If the calculation can't be computed such as northern and southern
2307         *         locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may not reach
2308         *         low enough below the horizon for this calculation, a <code>null</code> will be returned. See detailed
2309         *         explanation on top of the {@link AstronomicalCalendar} documentation.
2310         * 
2311         * @see #getAlos16Point1Degrees()
2312         * @see #getSeaLevelSunset()
2313         */
2314        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
2315        public Date getPlagAlosToSunset() {
2316                return getPlagHamincha(getAlos16Point1Degrees(), getElevationAdjustedSunset(), false);
2317        }
2318
2319        /**
2320         * This method returns the time of <em>plag hamincha</em> based on the opinion that the day starts at
2321         * {@link #getAlos16Point1Degrees() <em>alos</em> 16.1&deg;} and ends at {@link #getTzaisGeonim7Point083Degrees()
2322         * <em>tzais</em>}. 10.75 <em>shaos zmaniyos</em> are calculated based on this day and added to {@link
2323         * #getAlos16Point1Degrees() <em>alos</em>} to reach this time. This time is 10.75 <em>shaos zmaniyos</em> (temporal
2324         * hours) after {@link #getAlos16Point1Degrees() dawn} based on the opinion that the day is calculated from a
2325         * {@link #getAlos16Point1Degrees() dawn} of 16.1 degrees before sunrise to
2326         * {@link #getTzaisGeonim7Point083Degrees() <em>tzais</em>} . This returns the time of 10.75 * the calculated
2327         * <em>shaah zmanis</em> after {@link #getAlos16Point1Degrees() dawn}.
2328         * 
2329         * @return the <code>Date</code> of the <em>plag</em>. If the calculation can't be computed such as northern and
2330         *         southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may not
2331         *         reach low enough below the horizon for this calculation, a <code>null</code> will be returned. See
2332         *         detailed explanation on top of the {@link AstronomicalCalendar} documentation.
2333         * 
2334         * @see #getAlos16Point1Degrees()
2335         * @see #getTzaisGeonim7Point083Degrees()
2336         */
2337        public Date getPlagAlos16Point1ToTzaisGeonim7Point083Degrees() {
2338                return getPlagHamincha(getAlos16Point1Degrees(), getTzaisGeonim7Point083Degrees(), false);
2339        }
2340        
2341        /**
2342         * This method returns the time of <em>plag hamincha</em> (the earliest time that Shabbos can be started) based on the
2343         * opinion of <a href="https://en.wikipedia.org/wiki/Yaakov_Moshe_Hillel">Rabbi Yaakov Moshe Hillel</a> as published in
2344         * the <em>luach</em> of the Bais Horaah of Yeshivat Chevrat Ahavat Shalom that that <em>plag hamincha</em> is calculated
2345         * as 1.25 <em>shaos zmaniyos</em> before {@link #getTzaisGeonim3Point8Degrees() <em>tzais</em> 3.8&deg;} with <em>shaos
2346         * zmaniyos</em> calculated based on a day starting at {@link #getAlos16Point1Degrees() <em>alos</em> 16.1&deg;} and
2347         * ending at <em>tzais</em> 3.8&deg;.
2348         * 
2349         * @return the <code>Date</code> of the <em>plag</em>. If the calculation can't be computed such as northern and
2350         *         southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may not
2351         *         reach low enough below the horizon for this calculation, a <code>null</code> will be returned. See detailed
2352         *         explanation on top of the {@link AstronomicalCalendar} documentation.
2353         * 
2354         * @see #getShaahZmanisAlos16Point1ToTzais3Point8()
2355         * @see #getMinchaGedolaAhavatShalom()
2356         * @see #getMinchaKetanaAhavatShalom()
2357         */
2358        public Date getPlagAhavatShalom() {
2359                return getTimeOffset(getTzaisGeonim3Point8Degrees(), -getShaahZmanisAlos16Point1ToTzais3Point8() * 1.25);
2360        }
2361
2362        /**
2363         * Method to return the beginning of <em>bain hashmashos</em> of Rabbeinu Tam calculated when the sun is
2364         * {@link #ZENITH_13_POINT_24 13.24&deg;} below the western {@link #GEOMETRIC_ZENITH geometric horizon} (90&deg;)
2365         * after sunset. This calculation is based on the same calculation of {@link #getBainHashmashosRT58Point5Minutes()
2366         * <em>bain hashmashos</em> Rabbeinu Tam 58.5 minutes} but uses a degree-based calculation instead of 58.5 exact
2367         * minutes. This calculation is based on the position of the sun 58.5 minutes after sunset in Jerusalem <a href=
2368         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a>,
2369         * which calculates to 13.24&deg; below {@link #GEOMETRIC_ZENITH geometric zenith}.
2370         * NOTE: As per Yisrael Vehazmanim Vol. III page 1028, No. 50, a dip of slightly less than 13&deg; should be used.
2371         * Calculations show that the proper dip to be 13.2456&deg; (truncated to 13.24 that provides about 1.5 second
2372         * earlier (<em>lechumra</em>) time) below the horizon at that time. This makes a difference of 1 minute and 10
2373         * seconds in Jerusalem during the Equinox, and 1 minute 29 seconds during the solstice as compared to the proper
2374         * 13.24&deg; versus 13&deg;. For NY during the solstice, the difference is 1 minute 56 seconds.
2375         * @todo recalculate the above based on equilux/equinox calculations.
2376         * 
2377         * @return the <code>Date</code> of the sun being 13.24&deg; below {@link #GEOMETRIC_ZENITH geometric zenith}
2378         *         (90&deg;). If the calculation can't be computed such as northern and southern locations even south of the
2379         *         Arctic Circle and north of the Antarctic Circle where the sun may not reach low enough below the horizon
2380         *         for this calculation, a <code>null</code> will be returned. See detailed explanation on top of the
2381         *         {@link AstronomicalCalendar} documentation.
2382         * 
2383         * @see #ZENITH_13_POINT_24
2384         * @see #getBainHashmashosRT58Point5Minutes()
2385         */
2386        public Date getBainHashmashosRT13Point24Degrees() {
2387                return getSunsetOffsetByDegrees(ZENITH_13_POINT_24);
2388        }
2389        
2390
2391        /**
2392         * Misspelled method name that should be {@link #getBainHashmashosRT13Point24Degrees()}.
2393         * @return the properly spelled version.
2394         */
2395        @Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
2396        public Date getBainHasmashosRT13Point24Degrees() {
2397                return getBainHashmashosRT13Point24Degrees();
2398        }
2399
2400        /**
2401         * This method returns the beginning of <em>Bain hashmashos</em> of Rabbeinu Tam calculated as a 58.5-minute offset
2402         * after sunset. <em>bain hashmashos</em> is 3/4 of a <a href=
2403         * "https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a> before <em>tzais</em> or 3 1/4
2404         * mil after sunset. With a mil calculated as 18 minutes, 3.25 * 18 = 58.5 minutes.
2405         * 
2406         * @return the <code>Date</code> of 58.5 minutes after sunset. If the calculation can't be computed such as in the
2407         *         Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
2408         *         not set, a <code>null</code> will be returned. See detailed explanation on top of the
2409         *         {@link AstronomicalCalendar} documentation.
2410         * 
2411         */
2412        public Date getBainHashmashosRT58Point5Minutes() {
2413                return getTimeOffset(getElevationAdjustedSunset(), 58.5 * MINUTE_MILLIS);
2414        }
2415        
2416        /**
2417         * Misspelled method name that should be {@link #getBainHashmashosRT58Point5Minutes()}.
2418         * @return the properly spelled version.
2419         */
2420        @Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
2421        public Date getBainHasmashosRT58Point5Minutes() {
2422                return getBainHashmashosRT58Point5Minutes();
2423        }
2424
2425        /**
2426         * This method returns the beginning of <em>bain hashmashos</em> based on the calculation of 13.5 minutes (3/4 of an
2427         * 18-minute <a href="https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a>) before
2428         * <em>shkiah</em> calculated as {@link #getTzaisGeonim7Point083Degrees() 7.083&deg;}.
2429         * 
2430         * @return the <code>Date</code> of the <em>bain hashmashos</em> of Rabbeinu Tam in this calculation. If the
2431         *         calculation can't be computed such as northern and southern locations even south of the Arctic Circle and
2432         *         north of the Antarctic Circle where the sun may not reach low enough below the horizon for this
2433         *         calculation, a <code>null</code> will be returned. See detailed explanation on top of the
2434         *         {@link AstronomicalCalendar} documentation.
2435         * @see #getTzaisGeonim7Point083Degrees()
2436         */
2437        public Date getBainHashmashosRT13Point5MinutesBefore7Point083Degrees() {
2438                return getTimeOffset(getSunsetOffsetByDegrees(ZENITH_7_POINT_083), -13.5 * MINUTE_MILLIS);
2439        }
2440        
2441        /**
2442         * Misspelled method name that should be {@link #getBainHashmashosRT13Point5MinutesBefore7Point083Degrees()}.
2443         * @return the properly spelled version.
2444         */
2445        @Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
2446        public Date getBainHasmashosRT13Point5MinutesBefore7Point083Degrees() {
2447                return getBainHashmashosRT13Point5MinutesBefore7Point083Degrees();
2448        }
2449
2450        /**
2451         * This method returns the beginning of <em>bain hashmashos</em> of Rabbeinu Tam calculated according to the
2452         * opinion of the <em>Divrei Yosef</em> (see Yisrael Vehazmanim) calculated 5/18th (27.77%) of the time between
2453         * <em>alos</em> (calculated as 19.8&deg; before sunrise) and sunrise. This is added to sunset to arrive at the time
2454         * for <em>bain hashmashos</em> of Rabbeinu Tam.
2455         * 
2456         * @return the <code>Date</code> of <em>bain hashmashos</em> of Rabbeinu Tam for this calculation. If the
2457         *         calculation can't be computed such as northern and southern locations even south of the Arctic Circle and
2458         *         north of the Antarctic Circle where the sun may not reach low enough below the horizon for this
2459         *         calculation, a <code>null</code> will be returned. See detailed explanation on top of the
2460         *         {@link AstronomicalCalendar} documentation.
2461         */
2462        public Date getBainHashmashosRT2Stars() {
2463                Date alos19Point8 = getAlos19Point8Degrees();
2464                Date sunrise = getElevationAdjustedSunrise();
2465                if (alos19Point8 == null || sunrise == null) {
2466                        return null;
2467                }
2468                return getTimeOffset(getElevationAdjustedSunset(), (sunrise.getTime() - alos19Point8.getTime()) * (5 / 18d));
2469        }
2470        
2471        /**
2472         * Misspelled method name that should be {@link #getBainHashmashosRT2Stars()}.
2473         * @return the properly spelled version.
2474         */
2475        @Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
2476        public Date getBainHasmashosRT2Stars() {
2477                return getBainHashmashosRT2Stars();
2478        }
2479        
2480        /**
2481         * This method returns the beginning of <em>bain hashmashos</em> (twilight) according to the <a href=
2482         * "https://en.wikipedia.org/wiki/Eliezer_ben_Samuel">Yereim (Rabbi Eliezer of Metz)</a> calculated as 18 minutes
2483         * or 3/4 of a 24-minute <a href="https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement"
2484         * >mil</a> before sunset. According to the Yereim, <em>bain hashmashos</em> starts 3/4 of a mil before sunset and
2485         * <em>tzais</em> or nightfall starts at sunset.
2486         * 
2487         * @return the <code>Date</code> of 18 minutes before sunset. If the calculation can't be computed such as in the
2488         *         Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
2489         *         not set, a <code>null</code> will be returned. See detailed explanation on top of the
2490         *         {@link AstronomicalCalendar} documentation.
2491         * @see #getBainHashmashosYereim3Point05Degrees()
2492         */
2493        public Date getBainHashmashosYereim18Minutes() {
2494                return getTimeOffset(getElevationAdjustedSunset(), -18 * MINUTE_MILLIS);
2495        }
2496        
2497        /**
2498         * Misspelled method name that should be {@link #getBainHashmashosYereim18Minutes()}.
2499         * @return the properly spelled version.
2500         */
2501        @Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
2502        public Date getBainHasmashosYereim18Minutes() {
2503                return getBainHashmashosYereim18Minutes();
2504        }
2505        
2506        /**
2507         * This method returns the beginning of <em>bain hashmashos</em> (twilight) according to the <a href=
2508         * "https://en.wikipedia.org/wiki/Eliezer_ben_Samuel">Yereim (Rabbi Eliezer of Metz)</a> calculated as the sun's
2509         * position 3.05&deg; above the horizon <a href=
2510         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a>,
2511         * its position 18 minutes or 3/4 of an 24-minute <a href=
2512         * "https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a> before sunset. According to
2513         * the Yereim, <em>bain hashmashos</em> starts 3/4 of a mil before sunset and <em>tzais</em> or nightfall starts at
2514         * sunset. Note that <em>lechumra</em> (of about 14 seconds) a refraction value of 0.5166&deg; as opposed to the
2515         * traditional 0.566&deg; is used. This is more inline with the actual refraction in <em>Eretz Yisrael</em> and is
2516         * brought down by <a href=
2517         * "http://beinenu.com/rabbis/%D7%94%D7%A8%D7%91-%D7%99%D7%93%D7%99%D7%93%D7%99%D7%94-%D7%9E%D7%A0%D7%AA">Rabbi
2518         * Yedidya Manet</a> in his <a href="https://www.nli.org.il/en/books/NNL_ALEPH002542826/NLI">Zmanei Halacha
2519         * Lema'aseh</a> (p. 11). That is the first source that I am aware of that calculates degree-based Yereim
2520         * <em>zmanim</em>. The 0.5166&deg; refraction is also used by the <a href="https://zmanim.online/">Luach Itim
2521         * Lebinah</a>. Calculating the Yereim's <em>bain hashmashos</em> using 18-minute based degrees is also suggested
2522         * in the upcoming 8th edition of the zmanim Kehilchasam. For more details, see the article <a href=
2523         * "https://kosherjava.com/2020/12/07/the-yereims-bein-hashmashos/">The Yereim's <em>Bein Hashmashos</em></a>.
2524         * 
2525         * @todo recalculate based on equinox/equilux
2526         * @return the <code>Date</code> of the sun's position 3.05&deg; minutes before sunset. If the calculation can't
2527         *         be computed such as in the Arctic Circle where there is at least one day a year where the sun does not
2528         *         rise, and one where it does not set, a <code>null</code> will be returned. See detailed explanation on
2529         *         top of the {@link AstronomicalCalendar} documentation.
2530         * 
2531         * @see #ZENITH_MINUS_3_POINT_05
2532         * @see #getBainHashmashosYereim18Minutes()
2533         * @see #getBainHashmashosYereim2Point8Degrees()
2534         * @see #getBainHashmashosYereim2Point1Degrees()
2535         */
2536        public Date getBainHashmashosYereim3Point05Degrees() {
2537                return getSunsetOffsetByDegrees(ZENITH_MINUS_3_POINT_05);
2538        }
2539        
2540        /**
2541         * Misspelled method name that should be {@link #getBainHashmashosYereim3Point05Degrees()}.
2542         * @return the properly spelled version.
2543         */
2544        @Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
2545        public Date getBainHasmashosYereim3Point05Degrees() {
2546                return getBainHashmashosYereim3Point05Degrees();
2547        }
2548        
2549        
2550        /**
2551         * This method returns the beginning of <em>bain hashmashos</em> (twilight) according to the <a href=
2552         * "https://en.wikipedia.org/wiki/Eliezer_ben_Samuel">Yereim (Rabbi Eliezer of Metz)</a> calculated as 16.875
2553         * minutes or 3/4 of a 22.5-minute <a href=
2554         * "https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a> before sunset. According
2555         * to the Yereim, <em>bain hashmashos</em> starts 3/4 of a mil before sunset and <em>tzais</em> or nightfall starts
2556         * at sunset.
2557         * 
2558         * @return the <code>Date</code> of 16.875 minutes before sunset. If the calculation can't be computed such as in the
2559         *         Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
2560         *         not set, a <code>null</code> will be returned. See detailed explanation on top of the
2561         *         {@link AstronomicalCalendar} documentation.
2562         * 
2563         * @see #getBainHashmashosYereim2Point8Degrees()
2564         */
2565        public Date getBainHashmashosYereim16Point875Minutes() {
2566                return getTimeOffset(getElevationAdjustedSunset(), -16.875 * MINUTE_MILLIS);
2567        }
2568        
2569        /**
2570         * Misspelled method name that should be {@link #getBainHashmashosYereim16Point875Minutes()}.
2571         * @return the properly spelled version.
2572         */
2573        @Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
2574        public Date getBainHasmashosYereim16Point875Minutes() {
2575                return getBainHashmashosYereim16Point875Minutes();
2576        }
2577        
2578        /**
2579         * This method returns the beginning of <em>bain hashmashos</em> (twilight) according to the <a href=
2580         * "https://en.wikipedia.org/wiki/Eliezer_ben_Samuel">Yereim (Rabbi Eliezer of Metz)</a> calculated as the sun's
2581         * position 2.8&deg; above the horizon <a href=
2582         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a>,
2583         * its position 16.875 minutes or 3/4 of an 18-minute <a href=
2584         * "https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a> before sunset. According to
2585         * the Yereim, <em>bain hashmashos</em> starts 3/4 of a mil before sunset and <em>tzais</em> or nightfall
2586         * starts at sunset. Details, including how the degrees were calculated can be seen in the documentation of
2587         * {@link #getBainHashmashosYereim3Point05Degrees()}.
2588         * 
2589         * @return the <code>Date</code> of the sun's position 2.8&deg; minutes before sunset. If the calculation can't
2590         *         be computed such as in the Arctic Circle where there is at least one day a year where the sun does not
2591         *         rise, and one where it does not set, a <code>null</code> will be returned. See detailed explanation on
2592         *         top of the {@link AstronomicalCalendar} documentation.
2593         * 
2594         * @see #ZENITH_MINUS_2_POINT_8
2595         * @see #getBainHashmashosYereim16Point875Minutes()
2596         * @see #getBainHashmashosYereim3Point05Degrees()
2597         * @see #getBainHashmashosYereim2Point1Degrees()
2598         */
2599        public Date getBainHashmashosYereim2Point8Degrees() {
2600                return getSunsetOffsetByDegrees(ZENITH_MINUS_2_POINT_8);
2601        }
2602        
2603        /**
2604         * Misspelled method name that should be {@link #getBainHashmashosYereim2Point8Degrees()}.
2605         * @return the properly spelled version.
2606         */
2607        @Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
2608        public Date getBainHasmashosYereim2Point8Degrees() {
2609                return getBainHashmashosYereim2Point8Degrees();
2610        }
2611        
2612        
2613        /**
2614         * This method returns the beginning of <em>bain hashmashos</em> (twilight) according to the <a href=
2615         * "https://en.wikipedia.org/wiki/Eliezer_ben_Samuel">Yereim (Rabbi Eliezer of Metz)</a> calculated as 13.5 minutes
2616         * or 3/4 of an 18-minute <a href="https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a>
2617         * before sunset. According to the Yereim, <em>bain hashmashos</em> starts 3/4 of a mil before sunset and
2618         * <em>tzais</em> or nightfall starts at sunset.
2619         * 
2620         * @return the <code>Date</code> of 13.5 minutes before sunset. If the calculation can't be computed such as in the
2621         *         Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
2622         *         not set, a <code>null</code> will be returned. See detailed explanation on top of the
2623         *         {@link AstronomicalCalendar} documentation.
2624         * 
2625         * @see #getBainHashmashosYereim2Point1Degrees()
2626         */
2627        public Date getBainHashmashosYereim13Point5Minutes() {
2628                return getTimeOffset(getElevationAdjustedSunset(), -13.5 * MINUTE_MILLIS);
2629        }
2630        
2631        /**
2632         * Misspelled method name that should be {@link #getBainHashmashosYereim13Point5Minutes()}.
2633         * @return the properly spelled version.
2634         */
2635        @Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
2636        public Date getBainHasmashosYereim13Point5Minutes() {
2637                return getBainHashmashosYereim13Point5Minutes();
2638        }
2639        
2640        /**
2641         * This method returns the beginning of <em>bain hashmashos</em> according to the <a href=
2642         * "https://en.wikipedia.org/wiki/Eliezer_ben_Samuel">Yereim (Rabbi Eliezer of Metz)</a> calculated as the sun's
2643         * position 2.1&deg; above the horizon <a href=
2644         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a> in
2645         * Yerushalayim, its position 13.5 minutes or 3/4 of an 18-minute <a href=
2646         * "https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a> before sunset. According to the
2647         * Yereim, <em>bain hashmashos</em> starts 3/4 of a mil before sunset and <em>tzais</em> or nightfall starts
2648         * at sunset. Details, including how the degrees were calculated can be seen in the documentation of
2649         * {@link #getBainHashmashosYereim3Point05Degrees()}.
2650         * 
2651         * @return the <code>Date</code> of the sun's position 2.1&deg; minutes before sunset. If the calculation can't be
2652         *         computed such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and
2653         *         one where it does not set, a <code>null</code> will be returned. See detailed explanation on top of the
2654         *         {@link AstronomicalCalendar} documentation.
2655         * 
2656         * @see #ZENITH_MINUS_2_POINT_1
2657         * @see #getBainHashmashosYereim13Point5Minutes()
2658         * @see #getBainHashmashosYereim2Point8Degrees()
2659         * @see #getBainHashmashosYereim3Point05Degrees()
2660         */
2661        public Date getBainHashmashosYereim2Point1Degrees() {
2662                return getSunsetOffsetByDegrees(ZENITH_MINUS_2_POINT_1);
2663        }
2664        
2665        /**
2666         * Misspelled method name that should be {@link #getBainHashmashosYereim2Point1Degrees()}.
2667         * @return the properly spelled version.
2668         */
2669        @Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
2670        public Date getBainHasmashosYereim2Point1Degrees() {
2671                return getBainHashmashosYereim2Point1Degrees();
2672        }
2673        
2674        /**
2675         * This method returns the <em>tzais</em> (nightfall) based on the opinion of the <em>Geonim</em> calculated at the
2676         * sun's position at {@link #ZENITH_3_POINT_7 3.7&deg;} below the western horizon.
2677         * 
2678         * @return the <code>Date</code> representing the time when the sun is 3.7&deg; below sea level.
2679         * @see #ZENITH_3_POINT_7
2680         */
2681        public Date getTzaisGeonim3Point7Degrees() {
2682                return getSunsetOffsetByDegrees(ZENITH_3_POINT_7);
2683        }
2684
2685        /**
2686         * This method returns the <em>tzais</em> (nightfall) based on the opinion of the <em>Geonim</em> calculated at the
2687         * sun's position at {@link #ZENITH_3_POINT_8 3.8&deg;} below the western horizon.
2688         * 
2689         * @return the <code>Date</code> representing the time when the sun is 3.8&deg; below sea level.
2690         * @see #ZENITH_3_POINT_8
2691         */
2692        public Date getTzaisGeonim3Point8Degrees() {
2693                return getSunsetOffsetByDegrees(ZENITH_3_POINT_8);
2694        }
2695
2696        /**
2697         * This method returns the <em>tzais</em> (nightfall) based on the opinion of the <em>Geonim</em> calculated at the
2698         * sun's position at {@link #ZENITH_5_POINT_95 5.95&deg;} below the western horizon.
2699         * 
2700         * @return the <code>Date</code> representing the time when the sun is 5.95&deg; below sea level. If the calculation
2701         *         can't be computed such as northern and southern locations even south of the Arctic Circle and north of
2702         *         the Antarctic Circle where the sun may not reach low enough below the horizon for this calculation, a
2703         *         <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
2704         *         documentation.
2705         * @see #ZENITH_5_POINT_95
2706         */
2707        public Date getTzaisGeonim5Point95Degrees() {
2708                return getSunsetOffsetByDegrees(ZENITH_5_POINT_95);
2709        }
2710
2711        /**
2712         * This method returns the <em>tzais</em> (nightfall) based on the opinion of the <em>Geonim</em> calculated as 3/4
2713         * of a <a href="https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a> based on an
2714         * 18-minute mil, or 13.5 minutes. It is the sun's position at {@link #ZENITH_3_POINT_65 3.65&deg;} below the western
2715         * horizon. This is a very early <em>zman</em> and should not be relied on without Rabbinical guidance.
2716         * 
2717         * @return the <code>Date</code> representing the time when the sun is 3.65&deg; below sea level. If the calculation
2718         *         can't be computed such as northern and southern locations even south of the Arctic Circle and north of
2719         *         the Antarctic Circle where the sun may not reach low enough below the horizon for this calculation, a
2720         *         <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
2721         *         documentation.
2722         * @deprecated This will be removed in v3.0.0 since calculations show that this time is earlier than 13.5 minutes at
2723         *              the <a href="https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the
2724         *              equinox / equilux</a> in Jerusalem.
2725         * @see #ZENITH_3_POINT_65
2726         */
2727        @Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
2728        public Date getTzaisGeonim3Point65Degrees() {
2729                return getSunsetOffsetByDegrees(ZENITH_3_POINT_65);
2730        }
2731
2732        /**
2733         * This method returns the <em>tzais</em> (nightfall) based on the opinion of the <em>Geonim</em> calculated as 3/4
2734         * of a <a href="https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a> based on an
2735         * 18-minute mil, or 13.5 minutes. It is the sun's position at {@link #ZENITH_3_POINT_676 3.676&deg;} below the western
2736         * horizon based on the calculations of Stanley Fishkind. This is a very early <em>zman</em> and should not be
2737         * relied on without Rabbinical guidance.
2738         * 
2739         * @return the <code>Date</code> representing the time when the sun is 3.676&deg; below sea level. If the
2740         *         calculation can't be computed such as northern and southern locations even south of the Arctic Circle and
2741         *         north of the Antarctic Circle where the sun may not reach low enough below the horizon for this
2742         *         calculation, a <code>null</code> will be returned. See detailed explanation on top of the
2743         *         {@link AstronomicalCalendar} documentation.
2744         * @deprecated This will be removed in v3.0.0 since calculations show that this time is earlier than 13.5 minutes at
2745         *              the <a href="https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the
2746         *              equinox / equilux</a> in Jerusalem.
2747         * @see #ZENITH_3_POINT_676
2748         */
2749        @Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
2750        public Date getTzaisGeonim3Point676Degrees() {
2751                return getSunsetOffsetByDegrees(ZENITH_3_POINT_676);
2752        }
2753
2754        /**
2755         * This method returns the <em>tzais</em> (nightfall) based on the opinion of the <em>Geonim</em> calculated as 3/4
2756         * of a <a href="https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a> based on a
2757         * 24-minute mil, or 18 minutes. It is the sun's position at {@link #ZENITH_4_POINT_61 4.61&deg;} below the
2758         * western horizon. This is a very early <em>zman</em> and should not be relied on without Rabbinical guidance.
2759         * 
2760         * @return the <code>Date</code> representing the time when the sun is 4.61&deg; below sea level. If the calculation
2761         *         can't be computed such as northern and southern locations even south of the Arctic Circle and north of
2762         *         the Antarctic Circle where the sun may not reach low enough below the horizon for this calculation, a
2763         *         <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
2764         *         documentation.
2765         * @see #ZENITH_4_POINT_61
2766         */
2767        public Date getTzaisGeonim4Point61Degrees() {
2768                return getSunsetOffsetByDegrees(ZENITH_4_POINT_61);
2769        }
2770
2771        /**
2772         * This method returns the <em>tzais</em> (nightfall) based on the opinion of the <em>Geonim</em> calculated as 3/4
2773         * of a <a href="https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a>, based on a
2774         * 22.5-minute mil, or 16 7/8 minutes. It is the sun's position at {@link #ZENITH_4_POINT_37 4.37&deg;} below the western
2775         * horizon. This is a very early <em>zman</em> and should not be relied on without Rabbinical guidance.
2776         * 
2777         * @return the <code>Date</code> representing the time when the sun is 4.37&deg; below sea level. If the calculation
2778         *         can't be computed such as northern and southern locations even south of the Arctic Circle and north of
2779         *         the Antarctic Circle where the sun may not reach low enough below the horizon for this calculation, a
2780         *         <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
2781         *         documentation.
2782         * @see #ZENITH_4_POINT_37
2783         */
2784        public Date getTzaisGeonim4Point37Degrees() {
2785                return getSunsetOffsetByDegrees(ZENITH_4_POINT_37);
2786        }
2787
2788        /**
2789         * This method returns the <em>tzais</em> (nightfall) based on the opinion of the <em>Geonim</em> calculated as 3/4
2790         * of a 24-minute <a href="https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a>,
2791         * based on a mil being 24 minutes, and is calculated as 18 + 2 + 4 for a total of 24 minutes. It is the
2792         * sun's position at {@link #ZENITH_5_POINT_88 5.88&deg;} below the western horizon. This is a very early
2793         * <em>zman</em> and should not be relied on without Rabbinical guidance.
2794         * 
2795         * @todo Additional detailed documentation needed.
2796         * @return the <code>Date</code> representing the time when the sun is 5.88&deg; below sea level. If the calculation
2797         *         can't be computed such as northern and southern locations even south of the Arctic Circle and north of
2798         *         the Antarctic Circle where the sun may not reach low enough below the horizon for this calculation, a
2799         *         <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
2800         *         documentation.
2801         * @see #ZENITH_5_POINT_88
2802         */
2803        public Date getTzaisGeonim5Point88Degrees() {
2804                return getSunsetOffsetByDegrees(ZENITH_5_POINT_88);
2805        }
2806
2807        /**
2808         * This method returns the <em>tzais</em> (nightfall) based on the opinion of the <em>Geonim</em> calculated as 3/4
2809         * of a <a href="https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a> based on the
2810         * sun's position at {@link #ZENITH_4_POINT_8 4.8&deg;} below the western horizon. This is based on Rabbi Leo Levi's
2811         * calculations. This is a very early <em>zman</em> and should not be relied on without Rabbinical guidance.
2812         * @todo Additional documentation needed.
2813         * 
2814         * @return the <code>Date</code> representing the time when the sun is 4.8&deg; below sea level. If the calculation
2815         *         can't be computed such as northern and southern locations even south of the Arctic Circle and north of
2816         *         the Antarctic Circle where the sun may not reach low enough below the horizon for this calculation, a
2817         *         <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
2818         *         documentation.
2819         * @see #ZENITH_4_POINT_8
2820         */
2821        public Date getTzaisGeonim4Point8Degrees() {
2822                return getSunsetOffsetByDegrees(ZENITH_4_POINT_8);
2823        }
2824        
2825        
2826        /**
2827         * This method returns the <em>tzais</em> (nightfall) based on the opinion of the <em>Geonim</em> as calculated by
2828         * <a href="https://en.wikipedia.org/wiki/Yechiel_Michel_Tucazinsky">Rabbi Yechiel Michel Tucazinsky</a>. It is
2829         * based on of the position of the sun no later than {@link #getTzaisGeonim6Point45Degrees() 31 minutes} after sunset
2830         * in Jerusalem the height of the summer solstice and is 28 minutes after <em>shkiah</em> <a href=
2831         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a>. This
2832         * computes to 6.45&deg; below the western horizon.
2833         * @todo Additional documentation details needed.
2834         * 
2835         * @return the <code>Date</code> representing the time when the sun is 6.45&deg; below sea level. If the
2836         *         calculation can't be computed such as northern and southern locations even south of the Arctic Circle and
2837         *         north of the Antarctic Circle where the sun may not reach low enough below the horizon for this
2838         *         calculation, a <code>null</code> will be returned. See detailed explanation on top of the
2839         *         {@link AstronomicalCalendar} documentation.
2840         * @see #ZENITH_6_POINT_45
2841         */
2842        public Date getTzaisGeonim6Point45Degrees() {
2843                return getSunsetOffsetByDegrees(ZENITH_6_POINT_45);
2844        }
2845
2846        /**
2847         * This method returns the <em>tzais</em> (nightfall) based on the opinion of the <em>Geonim</em> calculated when the
2848         * sun's position {@link #ZENITH_7_POINT_083 7.083&deg; (or 7&deg; 5\u2032}) below the western horizon. This is often
2849         * referred to as 7&deg;5' or 7&deg; and 5 minutes. This calculation is based on the observation of 3 medium-sized
2850         * stars by Dr. Baruch (Berthold) Cohn in his <em>luach</em> <a href=
2851         * "https://sammlungen.ub.uni-frankfurt.de/freimann/content/titleinfo/983088">Tabellen enthaltend die Zeitangaben für
2852         * den Beginn der Nacht und des Tages für die Breitengrade + 66 bis -38</a> published in Strasbourg, France in 1899.
2853         * This calendar was very popular in Europe, and many other calendars based their time on it. <a href=
2854         * "https://en.wikipedia.org/wiki/David_Zvi_Hoffmann">Rav Dovid Tzvi Hoffman</a> in his
2855         * <a href="https://hebrewbooks.org/1053">Sh"Ut Melamed Leho'il</a> in an exchange of letters with Baruch Cohn in <a href=
2856         * "https://hebrewbooks.org/pdfpager.aspx?req=1053&st=&pgnum=37">Orach Chaim 30</a> agreed to this <em>zman</em> (page 36),
2857         * as did the Sh"Ut Bnei Tziyon and the Tenuvas Sadeh. It is very close to the time of the <a href=
2858         * "https://hebrewbooks.org/22044">Mekor Chesed</a> of the Sefer chasidim. It is close to the position of the sun 30 minutes
2859         * after sunset in Jerusalem <a href=
2860         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a>, but not
2861         * Exactly. The actual position of the sun 30 minutes after sunset in Jerusalem at the equilux is 7.205&deg; and 7.199&deg;
2862         * at the equinox. See Hazmanim Bahalacha vol 2, pages 520-521 for more details.
2863         * 
2864         * @return the <code>Date</code> representing the time when the sun is 7.083&deg; below sea level. If the
2865         *         calculation can't be computed such as northern and southern locations even south of the Arctic Circle and
2866         *         north of the Antarctic Circle where the sun may not reach low enough below the horizon for this
2867         *         calculation, a <code>null</code> will be returned. See detailed explanation on top of the
2868         *         {@link AstronomicalCalendar} documentation.
2869         * @see #ZENITH_7_POINT_083
2870         */
2871        public Date getTzaisGeonim7Point083Degrees() {
2872                return getSunsetOffsetByDegrees(ZENITH_7_POINT_083);
2873        }
2874        
2875        /**
2876         * This method returns <em>tzais</em> (nightfall) based on the opinion of the <em>Geonim</em> calculated as 45 minutes
2877         * after sunset during the summer solstice in New York, when the <em>neshef</em> (twilight) is the longest. The sun's
2878         * position at this time computes to {@link #ZENITH_7_POINT_67 7.75&deg;} below the western horizon. See <a href=
2879         * "https://hebrewbooks.org/pdfpager.aspx?req=921&pgnum=149">Igros Moshe Even Haezer 4, Ch. 4</a> (regarding
2880         * <em>tzais</em> for <em>krias Shema</em>). It is also mentioned in Rabbi Heber's <a href=
2881         * "https://hebrewbooks.org/53000">Shaarei Zmanim</a> on in
2882         * <a href="https://hebrewbooks.org/pdfpager.aspx?req=53055&pgnum=101">chapter 10 (page 87)</a> and
2883         * <a href="https://hebrewbooks.org/pdfpager.aspx?req=53055&pgnum=122">chapter 12 (page 108)</a>. Also see the
2884         * time of 45 minutes in <a href="https://en.wikipedia.org/wiki/Simcha_Bunim_Cohen">Rabbi Simcha Bunim Cohen's</a> <a
2885         * href="https://www.worldcat.org/oclc/179728985">The radiance of Shabbos</a> as the earliest <em>zman</em> for New York.
2886         * This <em>zman</em> is also listed in the <a href="https://hebrewbooks.org/pdfpager.aspx?req=1927&pgnum=90">Divrei
2887         * Shalom Vol. III, chapter 75</a>, and <a href="https://hebrewbooks.org/pdfpager.aspx?req=892&pgnum=431">Bais Av"i
2888         * Vol. III, chapter 117</a>. This <em>zman</em> is also listed in the Divrei Shalom etc. chapter 177 (FIXME - could not
2889         * be located). Since this <em>zman</em> depends on the level of light, Rabbi Yaakov Shakow presented this degree-based
2890         * calculation to Rabbi <a href="https://en.wikipedia.org/wiki/Shmuel_Kamenetsky">Rabbi Shmuel Kamenetsky</a> who agreed
2891         * to it.
2892         * @todo add hyperlinks to source of Divrei Shalom once it is located.
2893         * @return the <code>Date</code> representing the time when the sun is 7.67&deg; below sea level. If the
2894         *         calculation can't be computed such as northern and southern locations even south of the Arctic Circle and
2895         *         north of the Antarctic Circle where the sun may not reach low enough below the horizon for this
2896         *         calculation, a <code>null</code> will be returned. See detailed explanation on top of the
2897         *         {@link AstronomicalCalendar} documentation.
2898         * @see #ZENITH_7_POINT_67
2899         */
2900        public Date getTzaisGeonim7Point67Degrees() {
2901                return getSunsetOffsetByDegrees(ZENITH_7_POINT_67);
2902        }
2903
2904        /**
2905         * This method returns the <em>tzais</em> (nightfall) based on the opinion of the <em>Geonim</em> calculated at the
2906         * sun's position at {@link #ZENITH_8_POINT_5 8.5&deg;} below the western horizon.
2907         * 
2908         * @return the <code>Date</code> representing the time when the sun is 8.5&deg; below sea level. If the calculation
2909         *         can't be computed such as northern and southern locations even south of the Arctic Circle and north of
2910         *         the Antarctic Circle where the sun may not reach low enough below the horizon for this calculation, a
2911         *         <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
2912         *         documentation.
2913         * @see #ZENITH_8_POINT_5
2914         */
2915        public Date getTzaisGeonim8Point5Degrees() {
2916                return getSunsetOffsetByDegrees(ZENITH_8_POINT_5);
2917        }
2918        
2919        /**
2920         * This method returns the <em>tzais</em> (nightfall) based on the calculations used in the <a href=
2921         * "https://www.worldcat.org/oclc/243303103">Luach Itim Lebinah</a> as the stringent time for <em>tzais</em>.  It is
2922         * calculated at the sun's position at {@link #ZENITH_9_POINT_3 9.3&deg;} below the western horizon.
2923         * 
2924         * @return the <code>Date</code> representing the time when the sun is 9.3&deg; below sea level. If the calculation
2925         *         can't be computed such as northern and southern locations even south of the Arctic Circle and north of
2926         *         the Antarctic Circle where the sun may not reach low enough below the horizon for this calculation, a
2927         *         <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
2928         *         documentation.
2929         */
2930        public Date getTzaisGeonim9Point3Degrees() {
2931                return getSunsetOffsetByDegrees(ZENITH_9_POINT_3);
2932        }
2933        
2934        /**
2935         * This method returns the <em>tzais</em> (nightfall) based on the opinion of the <em>Geonim</em> calculated as 60
2936         * minutes after sunset <a href=
2937         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a>, the
2938         * day that a solar hour is 60 minutes in New York. The sun's position at this time computes to
2939         * {@link #ZENITH_9_POINT_75 9.75&deg;} below the western horizon. This is the opinion of <a href=
2940         * "https://en.wikipedia.org/wiki/Yosef_Eliyahu_Henkin">Rabbi Eliyahu Henkin</a>.  This also follows the opinion of
2941         * <a href="https://en.wikipedia.org/wiki/Shmuel_Kamenetsky">Rabbi Shmuel Kamenetsky</a>. Rabbi Yaakov Shakow presented
2942         * these degree-based times to Rabbi Shmuel Kamenetsky who agreed to them.
2943         * 
2944         * @todo recalculate based on equinox / equilux.
2945         * @return the <code>Date</code> representing the time when the sun is 9.75&deg; below sea level. If the calculation
2946         *         can't be computed such as northern and southern locations even south of the Arctic Circle and north of
2947         *         the Antarctic Circle where the sun may not reach low enough below the horizon for this calculation, a
2948         *         <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
2949         *         documentation.
2950         *
2951         * @see #getTzais60()
2952         */
2953        public Date getTzaisGeonim9Point75Degrees() {
2954                return getSunsetOffsetByDegrees(ZENITH_9_POINT_75);
2955        }
2956
2957        /**
2958         * This method returns the <em>tzais</em> (nightfall) based on the opinion of the <a href=
2959         * "https://en.wikipedia.org/wiki/Yair_Bacharach">Chavas Yair</a> and <a href=
2960         * "https://he.wikipedia.org/wiki/%D7%9E%D7%9C%D7%9B%D7%99%D7%90%D7%9C_%D7%A6%D7%91%D7%99_%D7%98%D7%A0%D7%A0%D7%91%D7%95%D7%99%D7%9D"
2961         * >Divrei Malkiel</a> that the time to walk the distance of a <a href=
2962         * "https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a> is 15 minutes, for a total of 60 minutes
2963         * for 4 mil after {@link #getSeaLevelSunset() sea level sunset}. See detailed documentation explaining the 60 minute concept at
2964         * {@link #getAlos60()}.
2965         * 
2966         * @return the <code>Date</code> representing 60 minutes after sea level sunset. If the calculation can't be
2967         *         computed such as in the Arctic Circle where there is at least one day a year where the sun does not rise,
2968         *         and one where it does not set, a <code>null</code> will be returned. See detailed explanation on top of the
2969         *         {@link AstronomicalCalendar} documentation.
2970         * 
2971         * @see #getAlos60()
2972         * @see #getPlagHamincha60Minutes()
2973         * @see #getShaahZmanis60Minutes()
2974         */
2975        public Date getTzais60() {
2976                return getTimeOffset(getElevationAdjustedSunset(), 60 * MINUTE_MILLIS);
2977        }
2978
2979        /**
2980         * This method returns <em>tzais</em> usually calculated as 40 minutes (configurable to any offset via
2981         * {@link #setAteretTorahSunsetOffset(double)}) after sunset. Please note that <em>Chacham</em> Yosef Harari-Raful
2982         * of Yeshivat Ateret Torah who uses this time, does so only for calculating various other <em>zmanei hayom</em>
2983         * such as <em>Sof Zman Krias Shema</em> and <em>Plag Hamincha</em>. His calendars do not publish a <em>zman</em>
2984         * for <em>Tzais</em>. It should also be noted that <em>Chacham</em> Harari-Raful provided a 25 minute <em>zman</em>
2985         * for Israel. This API uses 40 minutes year round in any place on the globe by default. This offset can be changed
2986         *  by calling {@link #setAteretTorahSunsetOffset(double)}.
2987         * 
2988         * @return the <code>Date</code> representing 40 minutes (configurable via {@link #setAteretTorahSunsetOffset})
2989         *         after sea level sunset. If the calculation can't be computed such as in the Arctic Circle where there is
2990         *         at least one day a year where the sun does not rise, and one where it does not set, a <code>null</code> will
2991         *         be returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
2992         * @see #getAteretTorahSunsetOffset()
2993         * @see #setAteretTorahSunsetOffset(double)
2994         */
2995        public Date getTzaisAteretTorah() {
2996                return getTimeOffset(getElevationAdjustedSunset(), getAteretTorahSunsetOffset() * MINUTE_MILLIS);
2997        }
2998
2999        /**
3000         * Returns the offset in minutes after sunset used to calculate <em>tzais</em> based on the calculations of
3001         * <em>Chacham</em> Yosef Harari-Raful of Yeshivat Ateret Torah calculations. The default value is 40 minutes.
3002         * This affects most <em>zmanim</em>, since almost all zmanim use subset as part of their calculation.
3003         * 
3004         * @return the number of minutes after sunset for <em>Tzait</em>.
3005         * @see #setAteretTorahSunsetOffset(double)
3006         */
3007        public double getAteretTorahSunsetOffset() {
3008                return ateretTorahSunsetOffset;
3009        }
3010
3011        /**
3012         * Allows setting the offset in minutes after sunset for the Ateret Torah <em>zmanim</em>. The default if unset is
3013         * 40 minutes. <em>Chacham</em> Yosef Harari-Raful of Yeshivat Ateret Torah uses 40 minutes globally with the exception
3014         * of Israel where a 25-minute offset is used. This 40-minute (or any other) offset can be overridden by this method.
3015         * This offset impacts all Ateret Torah <em>zmanim</em>.
3016         * 
3017         * @param ateretTorahSunsetOffset
3018         *            the number of minutes after sunset to use as an offset for the Ateret Torah <em>tzais</em>
3019         * @see #getAteretTorahSunsetOffset()
3020         */
3021        public void setAteretTorahSunsetOffset(double ateretTorahSunsetOffset) {
3022                this.ateretTorahSunsetOffset = ateretTorahSunsetOffset;
3023        }
3024
3025        /**
3026         * This method returns the latest <em>zman krias shema</em> (time to recite Shema in the morning) based on the
3027         * calculation of <em>Chacham</em> Yosef Harari-Raful of Yeshivat Ateret Torah, that the day starts
3028         * {@link #getAlos72Zmanis() 1/10th of the day} before sunrise and is usually calculated as ending
3029         * {@link #getTzaisAteretTorah() 40 minutes after sunset} (configurable to any offset via
3030         * {@link #setAteretTorahSunsetOffset(double)}). <em>shaos zmaniyos</em> are calculated based on this day and added
3031         * to {@link #getAlos72Zmanis() <em>alos</em>} to reach this time. This time is 3
3032         * {@link #getShaahZmanisAteretTorah() <em>shaos zmaniyos</em>} (temporal hours) after
3033         * {@link #getAlos72Zmanis() <em>alos</em> 72 <em>zmaniyos</em>}. <b>Note: </b> Based on this calculation <em>chatzos</em>
3034         * will not be at midday.
3035         * 
3036         * @return the <code>Date</code> of the latest <em>zman krias shema</em> based on this calculation. If the
3037         *         calculation can't be computed such as in the Arctic Circle where there is at least one day a year where
3038         *         the sun does not rise, and one where it does not set, a <code>null</code> will be returned. See detailed
3039         *         explanation on top of the {@link AstronomicalCalendar} documentation.
3040         * @see #getAlos72Zmanis()
3041         * @see #getTzaisAteretTorah()
3042         * @see #getAteretTorahSunsetOffset()
3043         * @see #setAteretTorahSunsetOffset(double)
3044         * @see #getShaahZmanisAteretTorah()
3045         */
3046        public Date getSofZmanShmaAteretTorah() {
3047                return getSofZmanShma(getAlos72Zmanis(), getTzaisAteretTorah(), false);
3048        }
3049
3050        /**
3051         * This method returns the latest <em>zman tfila</em> (time to recite the morning prayers) based on the calculation
3052         * of <em>Chacham</em> Yosef Harari-Raful of Yeshivat Ateret Torah, that the day starts {@link #getAlos72Zmanis()
3053         * 1/10th of the day} before sunrise and is usually calculated as ending {@link #getTzaisAteretTorah() 40 minutes
3054         * after sunset} (configurable to any offset via {@link #setAteretTorahSunsetOffset(double)}). <em>shaos zmaniyos</em>
3055         * are calculated based on this day and added to {@link #getAlos72Zmanis() <em>alos</em>} to reach this time. This time
3056         * is 4 * {@link #getShaahZmanisAteretTorah() <em>shaos zmaniyos</em>} (temporal hours) after
3057         * {@link #getAlos72Zmanis() <em>alos</em> 72 zmaniyos}.
3058         * <b>Note: </b> Based on this calculation <em>chatzos</em> will not be at midday.
3059         * 
3060         * @return the <code>Date</code> of the latest <em>zman krias shema</em> based on this calculation. If the
3061         *         calculation can't be computed such as in the Arctic Circle where there is at least one day a year where
3062         *         the sun does not rise, and one where it does not set, a <code>null</code> will be returned. See detailed
3063         *         explanation on top of the {@link AstronomicalCalendar} documentation.
3064         * @see #getAlos72Zmanis()
3065         * @see #getTzaisAteretTorah()
3066         * @see #getShaahZmanisAteretTorah()
3067         * @see #setAteretTorahSunsetOffset(double)
3068         */
3069        public Date getSofZmanTfilaAteretTorah() {
3070                return getSofZmanTfila(getAlos72Zmanis(), getTzaisAteretTorah(), false);
3071        }
3072        
3073        /**
3074         * @see #getSofZmanTfilaAteretTorah()
3075         * @deprecated misspelled method name (all other methods spell tfila without an H) to be removed in 3.0.0.
3076         * @return the <code>Date</code> of the latest <em>zman krias shema</em> based on this calculation. If the
3077         *         calculation can't be computed such as in the Arctic Circle where there is at least one day a year where
3078         *         the sun does not rise, and one where it does not set, a <code>null</code> will be returned. See detailed
3079         *         explanation on top of the {@link AstronomicalCalendar} documentation.
3080         */
3081        @Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
3082        public Date getSofZmanTfilahAteretTorah() {
3083                return getSofZmanTfila(getAlos72Zmanis(), getTzaisAteretTorah(), false);
3084        }
3085
3086        /**
3087         * This method returns the time of <em>mincha gedola</em> based on the calculation of <em>Chacham</em> Yosef
3088         * Harari-Raful of Yeshivat Ateret Torah, that the day starts {@link #getAlos72Zmanis() 1/10th of the day}
3089         * before sunrise and is usually calculated as ending {@link #getTzaisAteretTorah() 40 minutes after sunset}
3090         * (configurable to any offset via {@link #setAteretTorahSunsetOffset(double)}). This is the preferred earliest
3091         * time to pray <em>mincha</em> according to the opinion of the <a href="https://en.wikipedia.org/wiki/Maimonides"
3092         * >Rambam</a> and others. For more information on this see the documentation on {@link #getMinchaGedola() <em>mincha
3093         * gedola</em>}. This is calculated as 6.5 {@link #getShaahZmanisAteretTorah()  solar hours} after <em>alos</em>. The
3094         * calculation used is 6.5 * {@link #getShaahZmanisAteretTorah()} after {@link #getAlos72Zmanis() <em>alos</em>}.
3095         * 
3096         * @see #getAlos72Zmanis()
3097         * @see #getTzaisAteretTorah()
3098         * @see #getShaahZmanisAteretTorah()
3099         * @see #getMinchaGedola()
3100         * @see #getMinchaKetanaAteretTorah()
3101         * @see ZmanimCalendar#getMinchaGedola()
3102         * @see #getAteretTorahSunsetOffset()
3103         * @see #setAteretTorahSunsetOffset(double)
3104         * 
3105         * @return the <code>Date</code> of the time of <em>mincha gedola</em>. If the calculation can't be computed such as
3106         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
3107         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
3108         *         {@link AstronomicalCalendar} documentation.
3109         */
3110        public Date getMinchaGedolaAteretTorah() {
3111                return getMinchaGedola(getAlos72Zmanis(), getTzaisAteretTorah(), false);
3112        }
3113
3114        /**
3115         * This method returns the time of <em>mincha ketana</em> based on the calculation of
3116         * <em>Chacham</em> Yosef Harari-Raful of Yeshivat Ateret Torah, that the day starts
3117         * {@link #getAlos72Zmanis() 1/10th of the day} before sunrise and is usually calculated as ending
3118         * {@link #getTzaisAteretTorah() 40 minutes after sunset} (configurable to any offset via
3119         * {@link #setAteretTorahSunsetOffset(double)}). This is the preferred earliest time to pray <em>mincha</em>
3120         * according to the opinion of the <a href="https://en.wikipedia.org/wiki/Maimonides">Rambam</a> and others.
3121         * For more information on this see the documentation on {@link #getMinchaGedola() <em>mincha gedola</em>}. This is
3122         * calculated as 9.5 {@link #getShaahZmanisAteretTorah() solar hours} after {@link #getAlos72Zmanis() <em>alos</em>}.
3123         * The calculation used is 9.5 * {@link #getShaahZmanisAteretTorah()} after {@link #getAlos72Zmanis() <em>alos</em>}.
3124         * 
3125         * @see #getAlos72Zmanis()
3126         * @see #getTzaisAteretTorah()
3127         * @see #getShaahZmanisAteretTorah()
3128         * @see #getAteretTorahSunsetOffset()
3129         * @see #setAteretTorahSunsetOffset(double)
3130         * @see #getMinchaGedola()
3131         * @see #getMinchaKetana()
3132         * @return the <code>Date</code> of the time of <em>mincha ketana</em>. If the calculation can't be computed such as
3133         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
3134         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
3135         *         {@link AstronomicalCalendar} documentation.
3136         */
3137        public Date getMinchaKetanaAteretTorah() {
3138                return getMinchaKetana(getAlos72Zmanis(), getTzaisAteretTorah(), false);
3139        }
3140
3141        /**
3142         * This method returns the time of <em>plag hamincha</em> based on the calculation of <em>Chacham</em> Yosef Harari-Raful
3143         * of Yeshivat Ateret Torah, that the day starts {@link #getAlos72Zmanis() 1/10th of the day} before sunrise and is
3144         * usually calculated as ending {@link #getTzaisAteretTorah() 40 minutes after sunset} (configurable to any offset
3145         * via {@link #setAteretTorahSunsetOffset(double)}). <em>shaos zmaniyos</em> are calculated based on this day and
3146         * added to {@link #getAlos72Zmanis() <em>alos</em>} to reach this time. This time is 10.75
3147         * {@link #getShaahZmanisAteretTorah() <em>shaos zmaniyos</em>} (temporal hours) after {@link #getAlos72Zmanis()
3148         * dawn}.
3149         * 
3150         * @return the <code>Date</code> of the <em>plag</em>. If the calculation can't be computed such as in the Arctic Circle
3151         *         where there is at least one day a year where the sun does not rise, and one where it does not set, a null
3152         *         will be returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
3153         * @see #getAlos72Zmanis()
3154         * @see #getTzaisAteretTorah()
3155         * @see #getShaahZmanisAteretTorah()
3156         * @see #setAteretTorahSunsetOffset(double)
3157         * @see #getAteretTorahSunsetOffset()
3158         */
3159        public Date getPlagHaminchaAteretTorah() {
3160                return getPlagHamincha(getAlos72Zmanis(), getTzaisAteretTorah(), false);
3161        }
3162
3163        /**
3164         * Method to return <em>tzais</em> (dusk) calculated as 72 minutes zmaniyos, or 1/10th of the day after
3165         * {@link #getSeaLevelSunset() sea level sunset}. This is the way that the <a href=
3166         * "https://en.wikipedia.org/wiki/Abraham_Cohen_Pimentel">Minchas Cohen</a> in Ma'amar 2:4 calculates Rebbeinu Tam's
3167         * time of <em>tzeis</em>. It should be noted that this calculation results in the shortest time from sunset to
3168         * <em>tzais</em> being during the winter solstice, the longest at the summer solstice and 72 clock minutes at the
3169         * equinox. This does not match reality, since there is no direct relationship between the length of the day and
3170         * twilight. The shortest twilight is during the equinox, the longest is during the summer solstice, and in the
3171         * winter with the shortest daylight, the twilight period is longer than during the equinoxes.
3172         * 
3173         * @return the <code>Date</code> representing the time. If the calculation can't be computed such as in the Arctic
3174         *         Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
3175         *         a <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
3176         *         documentation.
3177         * @see #getAlos72Zmanis()
3178         */
3179        public Date getTzais72Zmanis() {
3180                return getZmanisBasedOffset(1.2);
3181        }
3182        
3183        /**
3184         * A utility method to return <em>alos</em> (dawn) or <em>tzais</em> (dusk) based on a fractional day offset.
3185         * @param hours the number of <em>shaos zmaniyos</em> (temporal hours) before sunrise or after sunset that defines dawn
3186         *        or dusk. If a negative number is passed in, it will return the time of <em>alos</em> (dawn) (subtracting the
3187         *        time from sunrise) and if a positive number is passed in, it will return the time of <em>tzais</em> (dusk)
3188         *        (adding the time to sunset). If 0 is passed in, a <code>null</code> will be returned (since we can't tell if it
3189         *        is sunrise or sunset based).
3190         * @return the <code>Date</code> representing the time. If the calculation can't be computed such as in the Arctic
3191         *         Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
3192         *         a <code>null</code> will be returned. A <code>null</code> will also be returned if 0 is passed in, since we can't
3193         *         tell if it is sunrise or sunset based. See detailed explanation on top of the {@link AstronomicalCalendar}
3194         *         documentation.
3195         */
3196        private Date getZmanisBasedOffset(double hours) {
3197                long shaahZmanis = getShaahZmanisGra();
3198                if (shaahZmanis == Long.MIN_VALUE || hours == 0) {
3199                        return null;
3200                }
3201
3202                if (hours > 0) {
3203                        return getTimeOffset(getElevationAdjustedSunset(), (long) (shaahZmanis * hours));
3204                } else {
3205                        return getTimeOffset(getElevationAdjustedSunrise(), (long) (shaahZmanis * hours));
3206                }
3207        }
3208
3209        /**
3210         * Method to return <em>tzais</em> (dusk) calculated using 90 minutes zmaniyos or 1/8th of the day after {@link
3211         * #getSeaLevelSunset() sea level sunset}. This time is known in Yiddish as the <em>achtel</em> (an eighth)
3212         * <em>zman</em>.
3213         * 
3214         * @return the <code>Date</code> representing the time. If the calculation can't be computed such as in the Arctic
3215         *         Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
3216         *         a <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
3217         *         documentation.
3218         * @see #getAlos90Zmanis()
3219         */
3220        public Date getTzais90Zmanis() {
3221                return getZmanisBasedOffset(1.5);
3222        }
3223
3224        /**
3225         * Method to return <em>tzais</em> (dusk) calculated using 96 minutes <em>zmaniyos</em> or 1/7.5 of the day after
3226         * {@link #getSeaLevelSunset() sea level sunset}.
3227         * 
3228         * @return the <code>Date</code> representing the time. If the calculation can't be computed such as in the Arctic
3229         *         Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
3230         *         a <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
3231         *         documentation.
3232         * @see #getAlos96Zmanis()
3233         */
3234        public Date getTzais96Zmanis() {
3235                return getZmanisBasedOffset(1.6);
3236        }
3237
3238        /**
3239         * Method to return <em>tzais</em> (dusk) calculated as 90 minutes after sea level sunset. This method returns
3240         * <em>tzais</em> (nightfall) based on the opinion of the Magen Avraham that the time to walk the distance of a
3241         * <a href="https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a> according to the
3242         * <a href="https://en.wikipedia.org/wiki/Maimonides">Rambam</a>'s opinion is 18 minutes, for a total of 90
3243         * minutes based on the opinion of Ula who calculated <em>tzais</em> as 5 mil after sea level
3244         * <em>shkiah</em> (sunset). A similar calculation {@link #getTzais19Point8Degrees()} uses solar position
3245         * calculations based on this time.
3246         * 
3247         * @return the <code>Date</code> representing the time. If the calculation can't be computed such as in the Arctic
3248         *         Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
3249         *         a <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
3250         *         documentation.
3251         * @see #getTzais19Point8Degrees()
3252         * @see #getAlos90()
3253         */
3254        public Date getTzais90() {
3255                return getTimeOffset(getElevationAdjustedSunset(), 90 * MINUTE_MILLIS);
3256        }
3257
3258        /**
3259         * This method should be used <em>lechumra</em> only and returns <em>tzais</em> (nightfall) based on the calculations
3260         * of <a href="https://en.wikipedia.org/wiki/Avraham_Chaim_Naeh">Rav Chaim Naeh</a> that the time to walk the
3261         * distance of a <a href="https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a>
3262         * according to the <a href="https://en.wikipedia.org/wiki/Maimonides">Rambam</a>'s opinion is 2/5 of an hour (24 minutes)
3263         * for a total of 120 minutes based on the opinion of <em>Ula</em> who calculated <em>tzais</em> as 5 mil after
3264         * sea level <em>shkiah</em> (sunset). A similar calculation {@link #getTzais26Degrees()} uses degree-based calculations
3265         * based on this 120 minute calculation. Since the <em>zman</em> is extremely late and at a point that is long past the
3266         * 18&deg; point where the darkest point is reached, it should only be used <em>lechumra</em>, such as delaying the start
3267         * of nighttime <em>mitzvos</em>.
3268         * 
3269         * @deprecated This method should be used <em>lechumra</em> only since it returns a very late time, and if used
3270         *         <em>lekula</em> can result in <em>chillul Shabbos</em> etc. There is no current plan to remove this
3271         *         method from the API, and this deprecation is intended to alert developers of the danger of using it.
3272         * 
3273         * @return the <code>Date</code> representing the time. If the calculation can't be computed such as in the Arctic
3274         *         Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
3275         *         a <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}.
3276         *         documentation.
3277         * @see #getTzais26Degrees()
3278         * @see #getAlos120()
3279         */
3280        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
3281        public Date getTzais120() {
3282                return getTimeOffset(getElevationAdjustedSunset(), 120 * MINUTE_MILLIS);
3283        }
3284
3285        /**
3286         * This method should be used <em>lechumra</em> only and returns <em>tzais</em> (dusk) calculated using 120 minutes
3287         * <em>zmaniyos</em> after {@link #getSeaLevelSunset() sea level sunset}. Since the <em>zman</em>
3288         * is extremely late and at a time when the sun is well below the 18&deg; point (scientifically the darkest point) in
3289         * most places on the globe, it should only be used <em>lechumra</em>, such as delaying the start of nighttime
3290         * <em>mitzvos</em>.
3291         * 
3292         * @deprecated This method should be used <em>lechumra</em> only since it returns a very late time, and if used
3293         *         <em>lekula</em> can result in <em>chillul Shabbos</em> etc. There is no current plan to remove this
3294         *         method from the API, and this deprecation is intended to alert developers of the danger of using it.
3295         * 
3296         * @return the <code>Date</code> representing the time. If the calculation can't be computed such as in the Arctic
3297         *         Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
3298         *         a <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
3299         *         documentation.
3300         * @see #getAlos120Zmanis()
3301         * @see #getTzais120()
3302         * @see #getTzais26Degrees()
3303         */
3304        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
3305        public Date getTzais120Zmanis() {
3306                return getZmanisBasedOffset(2.0);
3307        }
3308
3309        /**
3310         * This calculates the time of <em>tzais</em> at the point when the sun is 16.1&deg; below the horizon. This is
3311         * the sun's dip below the horizon 72 minutes after sunset according Rabbeinu Tam's calculation of <em>tzais</em>
3312         * <a href=
3313         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a> in
3314         * Jerusalem. The question of equinox VS equilux is complex, with Rabbi Meir Posen in the <a href=
3315         * "https://www.worldcat.org/oclc/956316270">Ohr Meir</a> of the opinion that the equilux should be used. See
3316         * Yisrael Vehazmanim vol I, 34:1:4. Rabbi Yedidya Manet in his <a href=
3317         * "https://www.nli.org.il/en/books/NNL_ALEPH002542826/NLI">Zmanei Halacha Lema'aseh</a> (4th edition part 2, pages
3318         * and 22 and 24) and Rabbi Yonah Mertzbuch (in a letter published by Rabbi Manet) are of the opinion that the
3319         * astronomical equinox should be used. The difference adds up to about 9 seconds, too trivial to make much of a
3320         * difference. For information on how this is calculated see the comments on {@link #getAlos16Point1Degrees()}.
3321         * 
3322         * @return the <code>Date</code> representing the time. If the calculation can't be computed such as northern and
3323         *         southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may
3324         *         not reach low enough below the horizon for this calculation, a <code>null</code> will be returned. See
3325         *         detailed explanation on top of the {@link AstronomicalCalendar} documentation.
3326         * @see #getTzais72()
3327         * @see #getAlos16Point1Degrees() for more information on this calculation.
3328         */
3329        public Date getTzais16Point1Degrees() {
3330                return getSunsetOffsetByDegrees(ZENITH_16_POINT_1);
3331        }
3332
3333        /**
3334         * This method should be used <em>lechumra</em> only and returns <em>tzais</em> based on when the sun is 26&deg;
3335         * below the horizon. For information on how this is calculated see the comments on {@link #getAlos26Degrees()}.
3336         * Since the <em>zman</em> is extremely late and at a point when it is long past the 18&deg; point where the
3337         * darkest point is reached, it should only be used <em>lechumra</em> such as delaying the start of nighttime
3338         * <em>mitzvos</em>.
3339         * 
3340         * @deprecated This method should be used <em>lechumra</em> only since it returns a very late time, and if used
3341         *         <em>lekula</em> can result in <em>chillul Shabbos</em> etc. There is no current plan to remove this
3342         *         method from the API, and this deprecation is intended to alert developers of the danger of using it.
3343         * 
3344         * @return the <code>Date</code> representing the time. If the calculation can't be computed such as northern and
3345         *         southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may
3346         *         not reach low enough below the horizon for this calculation, a <code>null</code> will be returned. See
3347         *         detailed explanation on top of the {@link AstronomicalCalendar} documentation.
3348         * @see #getTzais120()
3349         * @see #getAlos26Degrees()
3350         */
3351        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
3352        public Date getTzais26Degrees() {
3353                return getSunsetOffsetByDegrees(ZENITH_26_DEGREES);
3354        }
3355
3356        /**
3357         * For information on how this is calculated see the comments on {@link #getAlos18Degrees()}
3358         * 
3359         * @return the <code>Date</code> representing the time. If the calculation can't be computed such as northern and
3360         *         southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may
3361         *         not reach low enough below the horizon for this calculation, a <code>null</code> will be returned. See
3362         *         detailed explanation on top of the {@link AstronomicalCalendar} documentation.
3363         * @see #getAlos18Degrees()
3364         */
3365        public Date getTzais18Degrees() {
3366                return getSunsetOffsetByDegrees(ASTRONOMICAL_ZENITH);
3367        }
3368
3369        /**
3370         * For information on how this is calculated see the comments on {@link #getAlos19Point8Degrees()}
3371         * 
3372         * @return the <code>Date</code> representing the time. If the calculation can't be computed such as northern and
3373         *         southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may
3374         *         not reach low enough below the horizon for this calculation, a <code>null</code> will be returned. See
3375         *         detailed explanation on top of the {@link AstronomicalCalendar} documentation.
3376         * @see #getTzais90()
3377         * @see #getAlos19Point8Degrees()
3378         */
3379        public Date getTzais19Point8Degrees() {
3380                return getSunsetOffsetByDegrees(ZENITH_19_POINT_8);
3381        }
3382
3383        /**
3384         * A method to return <em>tzais</em> (dusk) calculated as 96 minutes after sea level sunset. For information on how
3385         * this is calculated see the comments on {@link #getAlos96()}.
3386         * 
3387         * @return the <code>Date</code> representing the time. If the calculation can't be computed such as in the Arctic
3388         *         Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
3389         *         a <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
3390         *         documentation.
3391         * @see #getAlos96()
3392         */
3393        public Date getTzais96() {
3394                return getTimeOffset(getElevationAdjustedSunset(), 96 * MINUTE_MILLIS);
3395        }
3396
3397        /**
3398         * A method that returns the local time for fixed <em>chatzos</em>. This time is noon and midnight adjusted from
3399         * standard time to account for the local latitude. The 360&deg; of the globe divided by 24 calculates to 15&deg;
3400         * per hour with 4 minutes per degree, so at a longitude of 0 , 15, 30 etc... <em>Chatzos</em> is at exactly 12:00
3401         * noon. This is the time of <em>chatzos</em> according to the <a href=
3402         * "https://en.wikipedia.org/wiki/Aruch_HaShulchan">Aruch Hashulchan</a> in <a href=
3403         * "https://hebrewbooks.org/pdfpager.aspx?req=7705&pgnum=426">Orach Chaim 233:14</a> and <a href=
3404         * "https://en.wikipedia.org/wiki/Moshe_Feinstein">Rabbi Moshe Feinstein</a> in Igros Moshe <a href=
3405         * "https://hebrewbooks.org/pdfpager.aspx?req=916&st=&pgnum=67">Orach Chaim 1:24</a> and <a href=
3406         * "https://hebrewbooks.org/pdfpager.aspx?req=14675&pgnum=191">2:20</a>.
3407         * Lakewood, N.J., with a longitude of -74.222, is 0.778 away from the closest multiple of 15 at -75&deg;. This
3408         * is multiplied by 4 to yield 3 minutes and 7 seconds for a <em>chatzos</em> of 11:56:53. This method is not tied
3409         * to the theoretical 15&deg; time zones, but will adjust to the actual time zone and <a
3410         * href="https://en.wikipedia.org/wiki/Daylight_saving_time">Daylight saving time</a>.
3411         * 
3412         * @return the Date representing the local <em>chatzos</em>
3413         * @see GeoLocation#getLocalMeanTimeOffset()
3414         * @see AstronomicalCalendar#getLocalMeanTime(double)
3415         */
3416        public Date getFixedLocalChatzos() {
3417                return getLocalMeanTime(12.0);
3418        }
3419
3420        /**
3421         * A method that returns the latest <em>zman krias shema</em> (time to recite Shema in the morning) calculated as 3
3422         * clock hours before {@link #getFixedLocalChatzos()}. Note that there are opinions brought down in Yisrael Vehazmanim
3423         * <a href="https://hebrewbooks.org/pdfpager.aspx?req=9765&st=&pgnum=85">page 57</a> and Rav Yitzchak Silber's <a href=
3424         * "https://www.worldcat.org/oclc/811253716">Shaos Shavos Bahalacha</a> that this calculation is a mistake and regular
3425         * <em>chatzos</em> should be used for clock-hour calculations as opposed to fixed local <em>chatzos</em>. According to
3426         * these opinions it should be 3 clock hours before regular <em>chatzos</em> as calculated in {@link
3427         * #getSofZmanShma3HoursBeforeChatzos()}.
3428         * 
3429         * @return the <code>Date</code> of the latest <em>zman krias shema</em> calculated as 3 clock hours before
3430         *         {@link #getFixedLocalChatzos()}.
3431         * @see #getFixedLocalChatzos()
3432         * @see #getSofZmanShma3HoursBeforeChatzos()
3433         * @see #getSofZmanTfilaFixedLocal()
3434         *         
3435         * @deprecated This method of calculating <em>sof zman Shma</em> is considered a mistaken understanding of the proper
3436         *         calculation of this <em>zman</em> in the opinion of Rav Yitzchak Silber's <a href=
3437         *         "https://www.worldcat.org/oclc/811253716">Sha'aos Shavos Bahalacha</a>. On pages 316-318 he discusses Rav Yisrael
3438         *         Harfenes's calculations and points to his seeming agreement that using fixed local <em>chatzos</em> as the focal
3439         *         point is problematic. See Yisrael Vehazmanim <a href=
3440         *         "https://hebrewbooks.org/pdfpager.aspx?req=9765&st=&pgnum=85">page 57</a>. While the Yisrael Vehazmanim mentions
3441         *         this issue in vol. 1, it was not corrected in the calculations in vol. 3 and other parts of the <em>sefer</em>.
3442         *         A competent rabbinical authority should be consulted before using this <em>zman</em>. Instead, the use of {@link
3443         *         #getSofZmanShma3HoursBeforeChatzos()} should be used to calculate <em>sof zman Tfila</em> using 3 fixed clock hours.
3444         *         This will likely be removed in v3.0.
3445         */
3446        @Deprecated // (since="2.4.0", forRemoval=true) // add back once Java 9 is the minimum supported version
3447        public Date getSofZmanShmaFixedLocal() {
3448                return getTimeOffset(getFixedLocalChatzos(), -180 * MINUTE_MILLIS);
3449        }
3450
3451        /**
3452         * This method returns the latest <em>zman tfila</em> (time to recite the morning prayers) calculated as 2 hours
3453         * before {@link #getFixedLocalChatzos()}. See the documentation on {@link #getSofZmanShmaFixedLocal()} showing
3454         * differing opinions on how the <em>zman</em> is calculated. According to many opinions {@link
3455         * #getSofZmanTfila2HoursBeforeChatzos()} should be used as opposed to this <em>zman</em>.
3456         * 
3457         * @return the <code>Date</code> of the latest <em>zman tfila</em>.
3458         * @see #getFixedLocalChatzos()
3459         * @see #getSofZmanShmaFixedLocal()
3460         * @see #getSofZmanTfila2HoursBeforeChatzos()
3461         *         
3462         * @deprecated This method of calculating <em>sof zman Tfila</em> is considered a mistaken understanding of the proper
3463         *         calculation of this <em>zman</em> in the opinion of Rav Yitzchak Silber's <a href=
3464         *         "https://www.worldcat.org/oclc/811253716">Sha'aos Shavos Bahalacha</a>. On pages 316-318 he discusses Rav Yisrael
3465         *         Harfenes's calculations and points to his seeming agreement that using fixed local <em>chatzos</em> as the focal
3466         *         point is problematic. See Yisrael Vehazmanim <a href=
3467         *         "https://hebrewbooks.org/pdfpager.aspx?req=9765&st=&pgnum=85">page 57</a>. While the Yisrael Vehazmanim mentions
3468         *         this issue in vol. 1, it was not corrected in the calculations in vol. 3 and other parts of the <em>sefer</em>.
3469         *         A competent rabbinical authority should be consulted before using this <em>zman</em>. Instead, the use of {@link
3470         *         #getSofZmanTfila2HoursBeforeChatzos()} should be used to calculate <em>sof zman Tfila</em> using 2 fixed
3471         *         clock hours. This will likely be removed in v3.0.
3472         */
3473        @Deprecated // (since="2.4.0", forRemoval=true) // add back once Java 9 is the minimum supported version
3474        public Date getSofZmanTfilaFixedLocal() {
3475                return getTimeOffset(getFixedLocalChatzos(), -120 * MINUTE_MILLIS);
3476        }
3477
3478        /**
3479         * Returns the latest time of <em>Kidush Levana</em> according to the <a
3480         * href="https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin">Maharil's</a> opinion that it is calculated as
3481         * halfway between <em>molad</em> and <em>molad</em>. This adds half the 29 days, 12 hours and 793 chalakim time
3482         * between <em>molad</em> and <em>molad</em> (14 days, 18 hours, 22 minutes and 666 milliseconds) to the month's <em>molad</em>.
3483         * If the time of <em>sof zman Kiddush Levana</em> occurs during the day (between the <em>alos</em> and <em>tzais</em> passed in
3484         * as parameters), it returns the <em>alos</em> passed in. If a <code>null</code> <em>alos</em> or <em>tzais</em> are passed to
3485         * this method, the non-daytime adjusted time will be returned.
3486         * 
3487         * @param alos
3488         *            the beginning of the Jewish day. If <em>Kidush Levana</em> occurs during the day (starting at <em>alos</em> and
3489         *            ending at <em>tzais</em>), the time returned will be <em>alos</em>. If either the <em>alos</em> or <em>tzais</em>
3490         *            parameters are null, no daytime adjustment will be made.
3491         * @param tzais
3492         *            the end of the Jewish day. If Kidush Levana occurs during the day (starting at <em>alos</em> and ending at
3493         *            <em>tzais</em>), the time returned will be <em>alos</em>. If either the <em>alos</em> or <em>tzais</em> parameter
3494         *            are null, no daytime adjustment will be made.
3495         * @return the Date representing the moment halfway between molad and molad. If the time occurs between
3496         *         <em>alos</em> and <em>tzais</em>, <em>alos</em> will be returned. If the <em>zman</em> will not occur on this day, a
3497         *         <code>null</code> will be returned.
3498         * @see #getSofZmanKidushLevanaBetweenMoldos()
3499         * @see #getSofZmanKidushLevana15Days(Date, Date)
3500         * @see JewishCalendar#getSofZmanKidushLevanaBetweenMoldos()
3501         */
3502        public Date getSofZmanKidushLevanaBetweenMoldos(Date alos, Date tzais) {
3503                JewishCalendar jewishCalendar = new JewishCalendar();
3504                jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
3505                                getCalendar().get(Calendar.DAY_OF_MONTH));
3506
3507                // Do not calculate for impossible dates, but account for extreme cases. In the extreme case of Rapa Iti in French
3508                // Polynesia on Dec 2027 when kiddush Levana 3 days can be said on <em>Rosh Chodesh</em>, the sof zman Kiddush Levana
3509                // will be on the 12th of the Teves. In the case of Anadyr, Russia on Jan, 2071, sof zman Kiddush Levana between the
3510                // moldos will occur is on the night of 17th of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).
3511                if (jewishCalendar.getJewishDayOfMonth() < 11 || jewishCalendar.getJewishDayOfMonth() > 16) { 
3512                        return null;
3513                }
3514                return getMoladBasedTime(jewishCalendar.getSofZmanKidushLevanaBetweenMoldos(), alos, tzais, false);
3515        }
3516        
3517        /**
3518         * Returns the Date of the <em>molad</em> based time if it occurs on the current date. Since <em>Kiddush Levana</em>
3519         * can only be said during the day, there are parameters to limit it to between <em>alos</em> and <em>tzais</em>. If
3520         * the time occurs between <em>alos</em> and <em>tzais</em>, <em>tzais</em> will be returned.
3521         * 
3522         * @param moladBasedTime
3523         *            the <em>molad</em> based time such as <em>molad</em>, <em>tchilas</em> and <em>sof zman Kiddush Levana</em>
3524         * @param alos
3525         *            optional start of day to limit <em>molad</em> times to the end of the night before or beginning of the next night.
3526         *            Ignored if either <em>alos</em> or <em>tzais</em> are null.
3527         * @param tzais
3528         *            optional end of day to limit <em>molad</em> times to the end of the night before or beginning of the next night.
3529         *            Ignored if either <em>tzais</em> or <em>alos</em> are null
3530         * @param techila
3531         *            is it the start of <em>Kiddush Levana</em> time or the end? If it is start roll it to the next <em>tzais</em>,
3532         *            and if it is the end, return the end of the previous night (<em>alos</em> passed in). Ignored if either
3533         *            <em>alos</em> or <em>tzais</em> are null.
3534         * @return the <em>molad</em> based time. If the <em>zman</em> does not occur during the current date, <code>null</code> will be
3535         *         returned.
3536         */
3537        private Date getMoladBasedTime(Date moladBasedTime, Date alos, Date tzais, boolean techila) {
3538                Date lastMidnight = getMidnightLastNight();
3539            Date midnightTonight = getMidnightTonight();
3540                if(moladBasedTime.before(lastMidnight) || moladBasedTime.after(midnightTonight)){ // Invalid time, bailout
3541                        return null;
3542                } else if (alos == null || tzais == null){ // Not enough info to adjust
3543                   return moladBasedTime;
3544                } else { // It's the daytime, get the next/prev night
3545                        if (moladBasedTime.after(alos) && moladBasedTime.before(tzais)) {
3546                                if (techila) {
3547                                        return tzais;
3548                                } else {
3549                                        return alos;
3550                                }
3551                        } else { // It's the night, the provided time is valid
3552                                return moladBasedTime;
3553                        }
3554                }
3555        }
3556
3557        /**
3558         * Returns the latest time of Kiddush Levana according to the <a
3559         * href="https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin">Maharil's</a> opinion that it is calculated as
3560         * halfway between <em>molad</em> and <em>molad</em>. This adds half the 29 days, 12 hours and 793 chalakim time between
3561         * <em>molad</em> and <em>molad</em> (14 days, 18 hours, 22 minutes and 666 milliseconds) to the month's <em>molad</em>.
3562         * The <em>sof zman Kiddush Levana</em> will be returned even if it occurs during the day. To limit the time to between
3563         * <em>tzais</em> and <em>alos</em>, see {@link #getSofZmanKidushLevanaBetweenMoldos(Date, Date)}.
3564         * 
3565         * @return the Date representing the moment halfway between molad and molad. If the time occurs between
3566         *         <em>alos</em> and <em>tzais</em>, <em>alos</em> will be returned. If the <em>zman</em> will not occur on this
3567         *         day, a <code>null</code> will be returned.
3568         * @see #getSofZmanKidushLevanaBetweenMoldos(Date, Date)
3569         * @see #getSofZmanKidushLevana15Days()
3570         * @see JewishCalendar#getSofZmanKidushLevanaBetweenMoldos()
3571         */
3572        public Date getSofZmanKidushLevanaBetweenMoldos() {
3573                return getSofZmanKidushLevanaBetweenMoldos(null, null); 
3574        }
3575
3576        /**
3577         * Returns the latest time of <em>Kiddush Levana</em> calculated as 15 days after the <em>molad</em>. This is the
3578         * opinion brought down in the Shulchan Aruch (Orach Chaim 426). It should be noted that some opinions hold that the
3579         * <a href="https://en.wikipedia.org/wiki/Moses_Isserles">Rema</a> who brings down the opinion of the <a
3580         * href="https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin">Maharil's</a> of calculating
3581         * {@link #getSofZmanKidushLevanaBetweenMoldos(Date, Date) half way between <em>molad</em> and <em>molad</em>} is of
3582         * the opinion that the Mechaber agrees to his opinion. Also see the Aruch Hashulchan. For additional details on the subject,
3583         * see Rabbi Dovid Heber's very detailed write-up in <em>Siman Daled</em> (chapter 4) of <a href=
3584         * "https://hebrewbooks.org/53000">Shaarei Zmanim</a>. If the time of <em>sof zman Kiddush Levana</em> occurs during
3585         * the day (between the <em>alos</em> and <em>tzais</em> passed in as parameters), it returns the <em>alos</em> passed in. If a
3586         * null <em>alos</em> or <em>tzais</em> are passed to this method, the non-daytime adjusted time will be returned.
3587         * 
3588         * @param alos
3589         *            the beginning of the Jewish day. If <em>Kidush Levana</em> occurs during the day (starting at <em>alos</em> and
3590         *            ending at <em>tzais</em>), the time returned will be <em>alos</em>. If either the <em>alos</em> or <em>tzais</em>
3591         *            parameters are null, no daytime adjustment will be made.
3592         * @param tzais
3593         *            the end of the Jewish day. If <em>Kidush Levana</em> occurs during the day (starting at <em>alos</em> and ending at
3594         *            <em>tzais</em>), the time returned will be <em>alos</em>. If either the <em>alos</em> or <em>tzais</em> parameters
3595         *            are null, no daytime adjustment will be made.
3596         *
3597         * @return the Date representing the moment 15 days after the molad. If the time occurs between <em>alos</em> and
3598         *         <em>tzais</em>, <em>alos</em> will be returned. If the <em>zman</em> will not occur on this day, a
3599         *         <code>null</code> will be returned.
3600         * 
3601         * @see #getSofZmanKidushLevanaBetweenMoldos(Date, Date)
3602         * @see JewishCalendar#getSofZmanKidushLevana15Days()
3603         */
3604        public Date getSofZmanKidushLevana15Days(Date alos, Date tzais) {
3605                JewishCalendar jewishCalendar = new JewishCalendar();
3606                jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
3607                                getCalendar().get(Calendar.DAY_OF_MONTH));
3608                // Do not calculate for impossible dates, but account for extreme cases. In the extreme case of Rapa Iti in
3609                // French Polynesia on Dec 2027 when kiddush Levana 3 days can be said on <em>Rosh Chodesh</em>, the sof zman Kiddush
3610                // Levana will be on the 12th of the Teves. in the case of Anadyr, Russia on Jan, 2071, sof zman kiddush levana will
3611                // occur after midnight on the 17th of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).
3612                if (jewishCalendar.getJewishDayOfMonth() < 11 || jewishCalendar.getJewishDayOfMonth() > 17) {
3613                        return null;
3614                }
3615                return getMoladBasedTime(jewishCalendar.getSofZmanKidushLevana15Days(), alos, tzais, false);
3616        }
3617
3618        /**
3619         * Returns the latest time of <em>Kiddush Levana</em> calculated as 15 days after the molad. This is the opinion of
3620         * the Shulchan Aruch (Orach Chaim 426). It should be noted that some opinions hold that the
3621         * <a href="https://en.wikipedia.org/wiki/Moses_Isserles">Rema</a> who brings down the opinion of the <a
3622         * href="https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin">Maharil's</a> of calculating
3623         * {@link #getSofZmanKidushLevanaBetweenMoldos(Date, Date) half way between <em>molad</em> and <em>molad</em>} is of
3624         * the opinion that the Mechaber agrees to his opinion. Also see the Aruch Hashulchan. For additional details on the subject,
3625         * See Rabbi Dovid Heber's very detailed write-up in Siman Daled (chapter 4) of <a href="https://hebrewbooks.org/53000">Shaarei
3626         * Zmanim</a>. The <em>sof zman Kiddush Levana</em> will be returned even if it occurs during the day. To limit the time to
3627         * between <em>tzais</em> and <em>alos</em>, see {@link #getSofZmanKidushLevana15Days(Date, Date)}.
3628         * 
3629         * @return the Date representing the moment 15 days after the <em>molad</em>. If the time occurs between
3630         *         <em>alos</em> and <em>tzais</em>, <em>alos</em> will be returned. If the <em>zman</em> will not occur on this day, a
3631         *         <code>null</code> will be returned.
3632         * 
3633         * @see #getSofZmanKidushLevana15Days(Date, Date)
3634         * @see #getSofZmanKidushLevanaBetweenMoldos()
3635         * @see JewishCalendar#getSofZmanKidushLevana15Days()
3636         * 
3637         */
3638        public Date getSofZmanKidushLevana15Days() {
3639                return getSofZmanKidushLevana15Days(null, null);
3640        }
3641        
3642        /**
3643         * Returns the earliest time of <em>Kiddush Levana</em> according to <a href=
3644         * "https://en.wikipedia.org/wiki/Yonah_Gerondi">Rabbeinu Yonah</a>'s opinion that it can be said 3 days after the
3645         * <em>molad</em>. The time will be returned even if it occurs during the day when <em>Kiddush Levana</em> can't be said.
3646         * Use {@link #getTchilasZmanKidushLevana3Days(Date, Date)} if you want to limit the time to night hours.
3647         * 
3648         * @return the Date representing the moment 3 days after the molad. If the <em>zman</em> will not occur on this day, a
3649         *         <code>null</code> will be returned.
3650         * @see #getTchilasZmanKidushLevana3Days(Date, Date)
3651         * @see #getTchilasZmanKidushLevana7Days()
3652         * @see JewishCalendar#getTchilasZmanKidushLevana3Days()
3653         */
3654        public Date getTchilasZmanKidushLevana3Days() {
3655                return getTchilasZmanKidushLevana3Days(null, null);
3656        }
3657
3658        /**
3659         * Returns the earliest time of <em>Kiddush Levana</em> according to <a href=
3660         * "https://en.wikipedia.org/wiki/Yonah_Gerondi">Rabbeinu Yonah</a>'s opinion that it can be said 3 days after the <em>molad</em>.
3661         * If the time of <em>tchilas zman Kiddush Levana</em> occurs during the day (between <em>alos</em> and <em>tzais</em> passed to
3662         * this method) it will return the following <em>tzais</em>. If null is passed for either <em>alos</em> or <em>tzais</em>, the actual
3663         * <em>tchilas zman Kiddush Levana</em> will be returned, regardless of if it is during the day or not.
3664         * 
3665         * @param alos
3666         *            the beginning of the Jewish day. If Kidush Levana occurs during the day (starting at <em>alos</em> and ending
3667         *            at <em>tzais</em>), the time returned will be <em>tzais</em>. If either the <em>alos</em> or <em>tzais</em> parameters
3668         *            are null, no daytime adjustment will be made.
3669         * @param tzais
3670         *            the end of the Jewish day. If <em>Kidush Levana</em> occurs during the day (starting at <em>alos</em> and ending at
3671         *            <em>tzais</em>), the time returned will be <em>tzais</em>. If either the <em>alos</em> or <em>tzais</em> parameters
3672         *            are null, no daytime adjustment will be made.
3673         *
3674         * @return the Date representing the moment 3 days after the molad. If the time occurs between <em>alos</em> and
3675         *         <em>tzais</em>, <em>tzais</em> will be returned. If the <em>zman</em> will not occur on this day, a
3676         *         <code>null</code> will be returned.
3677         * @see #getTchilasZmanKidushLevana3Days()
3678         * @see #getTchilasZmanKidushLevana7Days(Date, Date)
3679         * @see JewishCalendar#getTchilasZmanKidushLevana3Days()
3680         */
3681        public Date getTchilasZmanKidushLevana3Days(Date alos, Date tzais) {
3682                JewishCalendar jewishCalendar = new JewishCalendar();
3683                jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
3684                                getCalendar().get(Calendar.DAY_OF_MONTH));
3685                
3686                // Do not calculate for impossible dates, but account for extreme cases. Tchilas zman kiddush Levana 3 days for
3687                // the extreme case of Rapa Iti in French Polynesia on Dec 2027 when kiddush Levana 3 days can be said on the evening
3688                // of the 30th, the second night of Rosh Chodesh. The 3rd day after the <em>molad</em> will be on the 4th of the month.
3689                // In the case of Anadyr, Russia on Jan, 2071, when sof zman kiddush levana is on the 17th of the month, the 3rd day
3690                // from the molad will be on the 5th day of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).
3691                if (jewishCalendar.getJewishDayOfMonth() > 5 && jewishCalendar.getJewishDayOfMonth() < 30) {
3692                        return null;
3693                }
3694                
3695                Date zman = getMoladBasedTime(jewishCalendar.getTchilasZmanKidushLevana3Days(), alos, tzais, true);
3696                
3697                //Get the following month's zman kiddush Levana for the extreme case of Rapa Iti in French Polynesia on Dec 2027 when
3698                // kiddush Levana can be said on Rosh Chodesh (the evening of the 30th). See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (page 32)
3699                if (zman == null && jewishCalendar.getJewishDayOfMonth() == 30) {
3700                        jewishCalendar.forward(Calendar.MONTH, 1);
3701                        zman = getMoladBasedTime(jewishCalendar.getTchilasZmanKidushLevana3Days(), null, null, true);
3702                }
3703                
3704                return zman;
3705        }
3706        
3707        /**
3708         * Returns the point in time of <em>Molad</em> as a <code>Date</code> Object. For the traditional day of week, hour,
3709         * minute and chalakim, {@link JewishCalendar#getMoladAsDate()} and the not yet completed
3710         * {@link com.kosherjava.zmanim.hebrewcalendar.HebrewDateFormatter} that will have formatting for this.
3711         * 
3712         * @return the Date representing the moment of the molad. If the <em>molad</em> does not occur on this day, a
3713         *         <code>null</code> will be returned.
3714         * 
3715         * @see #getTchilasZmanKidushLevana3Days()
3716         * @see #getTchilasZmanKidushLevana7Days(Date, Date)
3717         * @see JewishCalendar#getMoladAsDate()
3718         */
3719        public Date getZmanMolad() {
3720                JewishCalendar jewishCalendar = new JewishCalendar();
3721                jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
3722                                getCalendar().get(Calendar.DAY_OF_MONTH));
3723                
3724                // Optimize to not calculate for impossible dates, but account for extreme cases. The molad in the extreme case of Rapa
3725                // Iti in French Polynesia on Dec 2027 occurs on the night of the 27th of Kislev. In the case of Anadyr, Russia on
3726                // Jan 2071, the molad will be on the 2nd day of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).
3727                if (jewishCalendar.getJewishDayOfMonth() > 2 && jewishCalendar.getJewishDayOfMonth() < 27) {
3728                        return null;
3729                }
3730                Date molad = getMoladBasedTime(jewishCalendar.getMoladAsDate(), null, null, true);
3731
3732                // deal with molad that happens on the end of the previous month
3733                if (molad == null && jewishCalendar.getJewishDayOfMonth() > 26) {
3734                        jewishCalendar.forward(Calendar.MONTH, 1);
3735                        molad = getMoladBasedTime(jewishCalendar.getMoladAsDate(), null, null, true);
3736                }
3737                return molad;
3738        }
3739        
3740        /**
3741         * Used by Molad based <em>zmanim</em> to determine if <em>zmanim</em> occur during the current day.
3742         * @see #getMoladBasedTime(Date, Date, Date, boolean)
3743         * @return previous midnight
3744         */
3745        private Date getMidnightLastNight() {
3746                Calendar midnight = (Calendar)getCalendar().clone();
3747                // reset hour, minutes, seconds and millis
3748                midnight.set(Calendar.HOUR_OF_DAY, 0);
3749                midnight.set(Calendar.MINUTE, 0);
3750                midnight.set(Calendar.SECOND, 0);
3751                midnight.set(Calendar.MILLISECOND, 0);
3752                return midnight.getTime();
3753        }
3754        
3755        /**
3756         * Used by Molad based <em>zmanim</em> to determine if <em>zmanim</em> occur during the current day.
3757         * @see #getMoladBasedTime(Date, Date, Date, boolean)
3758         * @return following midnight
3759         */
3760        private Date getMidnightTonight() {
3761                Calendar midnight = (Calendar)getCalendar().clone();
3762                midnight.add(Calendar.DAY_OF_YEAR, 1);//roll to tonight
3763                midnight.set(Calendar.HOUR_OF_DAY, 0);
3764                midnight.set(Calendar.MINUTE, 0);
3765                midnight.set(Calendar.SECOND, 0);
3766                midnight.set(Calendar.MILLISECOND, 0);
3767                return midnight.getTime();
3768        }
3769
3770        /**
3771         * Returns the earliest time of <em>Kiddush Levana</em> according to the opinions that it should not be said until 7
3772         * days after the <em>molad</em>. If the time of <em>tchilas zman Kiddush Levana</em> occurs during the day (between
3773         * {@link ZmanimCalendar#getAlos72() <em>alos</em>} and {@link ZmanimCalendar#getTzais72() <em>tzais</em>}) it
3774         * return the next <em>tzais</em>.
3775         * 
3776         * @param alos
3777         *            the beginning of the Jewish day. If <em>Kidush Levana</em> occurs during the day (starting at <em>alos</em>
3778         *            and ending at <em>tzais</em>), the time returned will be <em>tzais</em>. If either the <em>alos</em> or
3779         *            <em>tzais</em> parameters are null, no daytime adjustment will be made.
3780         * @param tzais
3781         *            the end of the Jewish day. If <em>Kidush Levana</em> occurs during the day (starting at <em>alos</em> and
3782         *            ending at <em>tzais</em>), the time returned will be <em>tzais</em>. If either the <em>alos</em> or
3783         *            <em>tzais</em> parameters are null, no daytime adjustment will be made.
3784         *
3785         * @return the Date representing the moment 7 days after the molad. If the time occurs between <em>alos</em> and
3786         *         <em>tzais</em>, <em>tzais</em> will be returned. If the <em>zman</em> will not occur on this day, a
3787         *         <code>null</code> will be returned.
3788         * @see #getTchilasZmanKidushLevana3Days(Date, Date)
3789         * @see #getTchilasZmanKidushLevana7Days()
3790         * @see JewishCalendar#getTchilasZmanKidushLevana7Days()
3791         */
3792        public Date getTchilasZmanKidushLevana7Days(Date alos, Date tzais) {
3793                JewishCalendar jewishCalendar = new JewishCalendar();
3794                jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
3795                                getCalendar().get(Calendar.DAY_OF_MONTH));
3796                
3797                // Optimize to not calculate for impossible dates, but account for extreme cases. Tchilas zman kiddush Levana 7 days for
3798                // the extreme case of Rapa Iti in French Polynesia on Jan 2028 (when kiddush Levana 3 days can be said on the evening
3799                // of the 30th, the second night of Rosh Chodesh), the 7th day after the molad will be on the 4th of the month.
3800                // In the case of Anadyr, Russia on Jan, 2071, when sof zman kiddush levana is on the 17th of the month, the 7th day
3801                // from the molad will be on the 9th day of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).
3802                if (jewishCalendar.getJewishDayOfMonth() < 4 || jewishCalendar.getJewishDayOfMonth() > 9) { 
3803                        return null;
3804                }
3805                
3806                return getMoladBasedTime(jewishCalendar.getTchilasZmanKidushLevana7Days(), alos, tzais, true);
3807        }
3808
3809        /**
3810         * Returns the earliest time of <em>Kiddush Levana</em> according to the opinions that it should not be said until 7
3811         * days after the <em>molad</em>. The time will be returned even if it occurs during the day when <em>Kiddush Levana</em>
3812         * can't be recited. Use {@link #getTchilasZmanKidushLevana7Days(Date, Date)} if you want to limit the time to night hours.
3813         * 
3814         * @return the Date representing the moment 7 days after the molad regardless of it is day or night. If the <em>zman</em>
3815         *         will not occur on this day, a <code>null</code> will be returned.
3816         * @see #getTchilasZmanKidushLevana7Days(Date, Date)
3817         * @see JewishCalendar#getTchilasZmanKidushLevana7Days()
3818         * @see #getTchilasZmanKidushLevana3Days()
3819         */
3820        public Date getTchilasZmanKidushLevana7Days() {
3821                return getTchilasZmanKidushLevana7Days(null, null);
3822        }
3823
3824        /**
3825         * This method returns the latest time one is allowed eating <em>chametz</em> on <em>Erev Pesach</em> according to
3826         * the opinion of the <a href="https://en.wikipedia.org/wiki/Vilna_Gaon">GRA</a>. This time is identical to the {@link
3827         * #getSofZmanTfilaGRA() <em>Sof zman tfilah</em> GRA} and is provided as a convenience method for those who are
3828         * unaware how this <em>zman</em> is calculated. This time is 4 hours into the day based on the opinion of the
3829         * <a href="https://en.wikipedia.org/wiki/Vilna_Gaon">GRA</a> that the day is calculated from sunrise to sunset.
3830         * This returns the time 4 * {@link #getShaahZmanisGra()} after {@link #getSeaLevelSunrise() sea level sunrise}. If it
3831         * is not <em>erev Pesach</em>, a null will be returned.
3832         * 
3833         * @see ZmanimCalendar#getShaahZmanisGra()
3834         * @see ZmanimCalendar#getSofZmanTfilaGRA()
3835         * @return the <code>Date</code> one is allowed eating <em>chametz</em> on <em>Erev Pesach</em>. If it is not <em>erev
3836         *         Pesach</em> or the calculation can't be computed such as in the Arctic Circle where there is at least one
3837         *         day a year where the sun does not rise, and one where it does not set, a <code>null</code> will be returned.
3838         *         See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
3839         * @todo in v 3.0.0 enable the calendar check for erev pesach and return <code>null</code> in all other cases.
3840         */
3841        public Date getSofZmanAchilasChametzGRA() {
3842                /*JewishCalendar jewishCalendar = new JewishCalendar();
3843                jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
3844                                getCalendar().get(Calendar.DAY_OF_MONTH));
3845                if (jewishCalendar.getJewishMonth() == JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() == 14) { 
3846                        return getSofZmanTfilaGRA();
3847                } else {
3848                        return null;
3849                }*/
3850                return getSofZmanTfilaGRA();
3851        }
3852
3853        /**
3854         * This method returns the latest time one is allowed eating <em>chametz</em> on <em>Erev Pesach</em> according to the
3855         * opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on <em>alos</em>
3856         * being {@link #getAlos72() 72} minutes before {@link #getSunrise() sunrise}. This time is identical to the
3857         * {@link #getSofZmanTfilaMGA72Minutes() <em>Sof zman tfilah</em> MGA 72 minutes}. This time is 4 {@link #getShaahZmanisMGA()
3858         * <em>shaos zmaniyos</em>} (temporal hours) after {@link #getAlos72() dawn} based on the opinion of the MGA that the day is
3859         * calculated from a {@link #getAlos72() dawn} of 72 minutes before sunrise to {@link #getTzais72() nightfall} of 72 minutes
3860         * after sunset. This returns the time of 4 * {@link #getShaahZmanisMGA()} after {@link #getAlos72() dawn}. If it is not
3861         * <em>erev Pesach</em>, a null will be returned.
3862         * 
3863         * @return the <code>Date</code> of the latest time of eating <em>chametz</em>. If it is not <em>erev Pesach</em> or the
3864         *         calculation can't be computed such as in the Arctic Circle where there is at least one day a year where the sun does
3865         *         not rise, and one where it does not set, a <code>null</code> will be returned. See detailed explanation on top of
3866         *         the {@link AstronomicalCalendar} documentation.
3867         * @todo in v 3.0.0 enable the calendar check for erev pesach and return <code>null</code> in all other cases.
3868         * @see #getShaahZmanisMGA()
3869         * @see #getAlos72()
3870         * @see #getSofZmanTfilaMGA72Minutes()
3871         */
3872        public Date getSofZmanAchilasChametzMGA72Minutes() {
3873                /*JewishCalendar jewishCalendar = new JewishCalendar();
3874                jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
3875                                getCalendar().get(Calendar.DAY_OF_MONTH));
3876                if (jewishCalendar.getJewishMonth() == JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() == 14) {
3877                        return getSofZmanTfilaMGA72Minutes();
3878                } else {
3879                        return null;
3880                }*/
3881                return getSofZmanTfilaMGA72Minutes();
3882        }
3883        
3884        /**
3885         * This method returns the latest time one is allowed eating <em>chametz</em> on <em>Erev Pesach</em> according to the
3886         * opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on <em>alos</em>
3887         * being {@link #getAlos72Zmanis() 72 zmaniyos} minutes before {@link #getSunrise() sunrise}. This time is identical to the
3888         * {@link #getSofZmanTfilaMGA72MinutesZmanis() <em>Sof zman tfilah</em> MGA 72 minutes zmanis}. This time is 4 {@link #getShaahZmanis72MinutesZmanis()
3889         * <em>shaos zmaniyos</em>} (temporal hours) after {@link #getAlos72() dawn} based on the opinion of the MGA that the day is
3890         * calculated from a {@link #getAlos72Zmanis() dawn} of 72 minutes zmanis before sunrise to {@link #getTzais72Zmanis() nightfall} of 72 minutes zmanis
3891         * after sunset. This returns the time of 4 * {@link #getShaahZmanis72MinutesZmanis()} after {@link #getAlos72Zmanis() dawn}. If it is not
3892         * <em>erev Pesach</em>, a null will be returned.
3893         *
3894         * @return the <code>Date</code> of the latest time of eating <em>chametz</em>. If it is not <em>erev Pesach</em> or the
3895         *         calculation can't be computed such as in the Arctic Circle where there is at least one day a year where the sun does
3896         *         not rise, and one where it does not set, a <code>null</code> will be returned. See detailed explanation on top of
3897         *         the {@link AstronomicalCalendar} documentation.
3898         * @todo in v 3.0.0 enable the calendar check for erev pesach and return <code>null</code> in all other cases.
3899         * @see #getShaahZmanis72MinutesZmanis()
3900         * @see #getAlos72Zmanis()
3901         * @see #getSofZmanTfilaMGA72MinutesZmanis()
3902         */
3903        public Date getSofZmanAchilasChametzMGA72MinutesZmanis() {
3904                JewishCalendar jewishCalendar = new JewishCalendar();
3905                jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
3906                                getCalendar().get(Calendar.DAY_OF_MONTH));
3907                if (jewishCalendar.getJewishMonth() == JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() == 14) {
3908                        return getSofZmanTfilaMGA72MinutesZmanis();
3909                } else {
3910                        return null;
3911                }
3912        }
3913
3914        /**
3915         * This method returns the latest time one is allowed eating <em>chametz</em> on <em>Erev Pesach</em> according to the
3916         * opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on <em>alos</em>
3917         * being {@link #getAlos16Point1Degrees() 16.1&deg;} before {@link #getSunrise() sunrise}. This time is 4 {@link
3918         * #getShaahZmanis16Point1Degrees() <em>shaos zmaniyos</em>} (solar hours) after {@link #getAlos16Point1Degrees() dawn}
3919         * based on the opinion of the MGA that the day is calculated from dawn to nightfall with both being 16.1&deg;
3920         * below sunrise or sunset. This returns the time of 4 {@link #getShaahZmanis16Point1Degrees()} after
3921         * {@link #getAlos16Point1Degrees() dawn}. If it is not <em>erev Pesach</em>, a null will be returned.
3922         * 
3923         * @return the <code>Date</code> of the latest time of eating <em>chametz</em>. If it is not <em>erev Pesach</em> or the
3924         *         calculation can't be computed such as northern and southern locations even south of the Arctic Circle and north
3925         *         of the Antarctic Circle where the sun may not reach low enough below the horizon for this calculation, a
3926         *         <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
3927         * @todo in v 3.0.0 enable the calendar check for erev pesach and return <code>null</code> in all other cases.
3928         * @see #getShaahZmanis16Point1Degrees()
3929         * @see #getAlos16Point1Degrees()
3930         * @see #getSofZmanTfilaMGA16Point1Degrees()
3931         */
3932        public Date getSofZmanAchilasChametzMGA16Point1Degrees() {
3933                /*JewishCalendar jewishCalendar = new JewishCalendar();
3934                jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
3935                                getCalendar().get(Calendar.DAY_OF_MONTH));
3936                if (jewishCalendar.getJewishMonth() == JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() == 14) {
3937                        return getSofZmanTfilaMGA16Point1Degrees();
3938                } else {
3939                        return null;
3940                }*/
3941                return getSofZmanTfilaMGA16Point1Degrees();
3942        }
3943
3944        /**
3945         * FIXME adjust for synchronous
3946         * This method returns the latest time for burning <em>chametz</em> on <em>Erev Pesach</em> according to the opinion
3947         * of the <a href="https://en.wikipedia.org/wiki/Vilna_Gaon">GRA</a>. This time is 5 hours into the day based on the
3948         * opinion of the <a href="https://en.wikipedia.org/wiki/Vilna_Gaon">GRA</a> that the day is calculated from
3949         * sunrise to sunset. This returns the time 5 * {@link #getShaahZmanisGra()} after {@link #getSeaLevelSunrise() sea
3950         * level sunrise}. If it is not  <em>erev Pesach</em>, a null will be returned.
3951         * @todo in v 3.0.0 enable the calendar check for erev pesach and return <code>null</code> in all other cases.
3952         * @see ZmanimCalendar#getShaahZmanisGra()
3953         * @return the <code>Date</code> of the latest time for burning <em>chametz</em> on <em>Erev Pesach</em>. If it is not
3954         *         <em>erev Pesach</em> or the calculation can't be computed such as in the Arctic Circle where there is at least
3955         *         one day a year where the sun does not rise, and one where it does not set, a <code>null</code> will be
3956         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
3957         */
3958        public Date getSofZmanBiurChametzGRA() {
3959                /*JewishCalendar jewishCalendar = new JewishCalendar();
3960                jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
3961                                getCalendar().get(Calendar.DAY_OF_MONTH));
3962                if (jewishCalendar.getJewishMonth() == JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() == 14) {
3963                        return getTimeOffset(getElevationAdjustedSunrise(), getShaahZmanisGra() * 5);
3964                } else {
3965                        return null;
3966                }*/
3967                return getTimeOffset(getElevationAdjustedSunrise(), getShaahZmanisGra() * 5);
3968        }
3969
3970        /**
3971         * FIXME adjust for synchronous
3972         * This method returns the latest time for burning <em>chametz</em> on <em>Erev Pesach</em> according to the opinion of
3973         * the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on <em>alos</em>
3974         * being {@link #getAlos72() 72} minutes before {@link #getSunrise() sunrise}. This time is 5 {@link
3975         * #getShaahZmanisMGA() <em>shaos zmaniyos</em>} (temporal hours) after {@link #getAlos72() dawn} based on the opinion of
3976         * the MGA that the day is calculated from a {@link #getAlos72() dawn} of 72 minutes before sunrise to {@link
3977         * #getTzais72() nightfall} of 72 minutes after sunset. This returns the time of 5 * {@link #getShaahZmanisMGA()} after
3978         * {@link #getAlos72() dawn}. If it is not  <em>erev Pesach</em>, a null will be returned.
3979         * @todo in v 3.0.0 enable the calendar check for erev pesach and return <code>null</code> in all other cases.
3980         * @return the <code>Date</code> of the latest time for burning <em>chametz</em> on <em>Erev Pesach</em>. If it is not
3981         *         <em>erev Pesach</em> or the calculation can't be computed such as in the Arctic Circle where there is at
3982         *         least one day a year where the sun does not rise, and one where it does not set, a <code>null</code> will be
3983         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
3984         * @see #getShaahZmanisMGA()
3985         * @see #getAlos72()
3986         */
3987        public Date getSofZmanBiurChametzMGA72Minutes() {
3988                /*JewishCalendar jewishCalendar = new JewishCalendar();
3989                jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
3990                                getCalendar().get(Calendar.DAY_OF_MONTH));
3991                if (jewishCalendar.getJewishMonth() == JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() == 14) {
3992                        return getTimeOffset(getAlos72(), getShaahZmanisMGA() * 5);
3993                } else {
3994                        return null;
3995                }*/
3996                return getTimeOffset(getAlos72(), getShaahZmanisMGA() * 5);
3997        }
3998        
3999        /**
4000         * FIXME adjust for synchronous
4001         * This method returns the latest time for burning <em>chametz</em> on <em>Erev Pesach</em> according to the opinion of
4002         * the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on <em>alos</em>
4003         * being {@link #getAlos72Zmanis() 72} minutes zmanis before {@link #getSunrise() sunrise}. This time is 5 {@link
4004         * #getShaahZmanis72MinutesZmanis() <em>shaos zmaniyos</em>} (temporal hours) after {@link #getAlos72Zmanis() dawn} based on the opinion of
4005         * the MGA that the day is calculated from a {@link #getAlos72Zmanis() dawn} of 72 minutes zmanis before sunrise to {@link
4006         * #getTzais72Zmanis() nightfall} of 72 minutes zmanis after sunset. This returns the time of 5 * {@link #getShaahZmanis72MinutesZmanis()} after
4007         * {@link #getAlos72Zmanis() dawn}. If it is not  <em>erev Pesach</em>, a null will be returned.
4008         * @todo in v 3.0.0 enable the calendar check for erev pesach and return <code>null</code> in all other cases.
4009         * @return the <code>Date</code> of the latest time for burning <em>chametz</em> on <em>Erev Pesach</em>. If it is not
4010         *         <em>erev Pesach</em> or the calculation can't be computed such as in the Arctic Circle where there is at
4011         *         least one day a year where the sun does not rise, and one where it does not set, a <code>null</code> will be
4012         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
4013         * @see #getShaahZmanis72MinutesZmanis()
4014         * @see #getAlos72Zmanis()
4015         */
4016        public Date getSofZmanBiurChametzMGA72MinutesZmanis() {
4017                JewishCalendar jewishCalendar = new JewishCalendar();
4018                jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
4019                                getCalendar().get(Calendar.DAY_OF_MONTH));
4020                if (jewishCalendar.getJewishMonth() == JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() == 14) {
4021                        return getTimeOffset(getAlos72Zmanis(), getShaahZmanis72MinutesZmanis() * 5);
4022                } else {
4023                        return null;
4024                }
4025        }
4026
4027        /**
4028         * FIXME adjust for synchronous
4029         * This method returns the latest time for burning <em>chametz</em> on <em>Erev Pesach</em> according to the opinion
4030         * of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on <em>alos</em>
4031         * being {@link #getAlos16Point1Degrees() 16.1&deg;} before {@link #getSunrise() sunrise}. This time is 5
4032         * {@link #getShaahZmanis16Point1Degrees() <em>shaos zmaniyos</em>} (solar hours) after {@link #getAlos16Point1Degrees()
4033         * dawn} based on the opinion of the MGA that the day is calculated from dawn to nightfall with both being 16.1&deg;
4034         * below sunrise or sunset. This returns the time of 5 {@link #getShaahZmanis16Point1Degrees()} after
4035         * {@link #getAlos16Point1Degrees() dawn}. If it is not  <em>erev Pesach</em>, a null will be returned.
4036         * @todo in v 3.0.0 enable the calendar check for erev pesach and return <code>null</code> in all other cases.
4037         * @return the <code>Date</code> of the latest time for burning <em>chametz</em> on <em>Erev Pesach</em>. If it is not
4038         *         <em>erev Pesach</em> or the calculation can't be computed such as northern and southern locations even south
4039         *         of the Arctic Circle and north of the Antarctic Circle where the sun may not reach low enough below the
4040         *         horizon for this calculation, a <code>null</code> will be returned. See detailed explanation on top of the
4041         *         {@link AstronomicalCalendar} documentation.
4042         * 
4043         * @see #getShaahZmanis16Point1Degrees()
4044         * @see #getAlos16Point1Degrees()
4045         */
4046        public Date getSofZmanBiurChametzMGA16Point1Degrees() {
4047                /*JewishCalendar jewishCalendar = new JewishCalendar();
4048                jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
4049                                getCalendar().get(Calendar.DAY_OF_MONTH));
4050                if (jewishCalendar.getJewishMonth() == JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() == 14) {
4051                        return getTimeOffset(getAlos16Point1Degrees(), getShaahZmanis16Point1Degrees() * 5);
4052                } else {
4053                        return null;
4054                }*/
4055                return getTimeOffset(getAlos16Point1Degrees(), getShaahZmanis16Point1Degrees() * 5);
4056        }
4057
4058        /**
4059         * A method that returns the <a href="https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi">Baal Hatanya</a>'s
4060         * <em>netz amiti</em> (sunrise) without {@link AstronomicalCalculator#getElevationAdjustment(double)
4061         * elevation adjustment}. This forms the base for the Baal Hatanya's dawn-based calculations that are
4062         * calculated as a dip below the horizon before sunrise.
4063         *
4064         * According to the Baal Hatanya, <em>netz amiti</em>, or true (halachic) sunrise, is when the top of the sun's
4065         * disk is visible at an elevation similar to the mountains of Eretz Yisrael. The time is calculated as the point at which
4066         * the center of the sun's disk is 1.583&deg; below the horizon. This degree-based calculation can be found in Rabbi Shalom
4067         * DovBer Levine's commentary on The <a href="https://www.chabadlibrary.org/books/pdf/Seder-Hachnosas-Shabbos.pdf">Baal
4068         * Hatanya's Seder Hachnasas Shabbos</a>. From an elevation of 546 meters, the top of <a href=
4069         * "https://en.wikipedia.org/wiki/Mount_Carmel">Har Hacarmel</a>, the sun disappears when it is 1&deg; 35' or 1.583&deg;
4070         * below the sea level horizon. This in turn is based on the Gemara <a href=
4071         * "https://hebrewbooks.org/shas.aspx?mesechta=2&daf=35">Shabbos 35a</a>. There are other opinions brought down by
4072         * Rabbi Levine, including Rabbi Yosef Yitzchok Feigelstock who calculates it as the degrees below the horizon 4 minutes after
4073         * sunset in Yerushalayim (on the equinox). That is brought down as 1.583&deg;. This is identical to the 1&deg; 35' <em>zman</em>
4074         * and is probably a typo and should be 1.683&deg;. These calculations are used by most <a href=
4075         * "https://en.wikipedia.org/wiki/Chabad">Chabad</a> calendars that use the Baal Hatanya's <em>zmanim</em>. See
4076         * <a href="https://www.chabad.org/library/article_cdo/aid/3209349/jewish/About-Our-Zmanim-Calculations.htm">About Our
4077         * <em>Zmanim</em> Calculations @ Chabad.org</a>.
4078         *
4079         * Note: <em>netz amiti</em> is used only for calculating certain <em>zmanim</em>, and is intentionally unpublished. For
4080         * practical purposes, daytime <em>mitzvos</em> like <em>shofar</em> and <em>lulav</em> should not be done until after the
4081         * published time for <em>netz</em> / sunrise.
4082         * 
4083         * @return the <code>Date</code> representing the exact sea level <em>netz amiti</em> (sunrise) time. If the calculation can't be
4084         *         computed such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
4085         *         where it does not set, a <code>null</code> will be returned. See detailed explanation on top of the page.
4086         * 
4087         * @see #getSunrise()
4088         * @see #getSeaLevelSunrise()
4089         * @see #getSunsetBaalHatanya()
4090         * @see #ZENITH_1_POINT_583
4091         */
4092        private Date getSunriseBaalHatanya() {
4093                return getSunriseOffsetByDegrees(ZENITH_1_POINT_583);
4094        }
4095
4096        /**
4097         * A method that returns the <a href="https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi">Baal Hatanya</a>'s
4098         * <em>shkiah amiti</em> (sunset) without {@link AstronomicalCalculator#getElevationAdjustment(double)
4099         * elevation adjustment}. This forms the base for the Baal Hatanya's dusk-based calculations that are calculated
4100         * as a dip below the horizon after sunset.
4101         * 
4102         * According to the Baal Hatanya, <em>shkiah amiti</em>, true (<em>halachic</em>) sunset, is when the top of the 
4103         * sun's disk disappears from view at an elevation similar to the mountains of <em>Eretz Yisrael</em>.
4104         * This time is calculated as the point at which the center of the sun's disk is 1.583 degrees below the horizon.
4105         *
4106         * Note: <em>shkiah amiti</em> is used only for calculating certain <em>zmanim</em>, and is intentionally unpublished. For
4107         * practical purposes, all daytime mitzvos should be completed before the published time for <em>shkiah</em> / sunset.
4108         *
4109         * For further explanation of the calculations used for the Baal Hatanya's <em>zmanim</em> in this library, see
4110         * <a href="https://www.chabad.org/library/article_cdo/aid/3209349/jewish/About-Our-Zmanim-Calculations.htm">About Our
4111         * <em>Zmanim</em> Calculations @ Chabad.org</a>.
4112         * 
4113         * @return the <code>Date</code> representing the exact sea level <em>shkiah amiti</em> (sunset) time. If the calculation
4114         *         can't be computed such as in the Arctic Circle where there is at least one day a year where the sun does not
4115         *         rise, and one where it does not set, a <code>null</code> will be returned. See detailed explanation on top of
4116         *         the {@link AstronomicalCalendar} documentation.
4117         * 
4118         * @see #getSunset()
4119         * @see #getSeaLevelSunset()
4120         * @see #getSunriseBaalHatanya()
4121         * @see #ZENITH_1_POINT_583
4122         */
4123        private Date getSunsetBaalHatanya() {
4124                return getSunsetOffsetByDegrees(ZENITH_1_POINT_583);
4125        }
4126
4127        /**
4128         * A method that returns the <a href="https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi">Baal Hatanya</a>'s
4129         * a <em>shaah zmanis</em> ({@link #getTemporalHour(Date, Date) temporal hour}). This forms the base for the
4130         * Baal Hatanya's  day  based calculations that are calculated as a 1.583&deg; dip below the horizon after sunset.
4131         * According to the Baal Hatanya, <em>shkiah amiti</em>, true (halachic) sunset, is when the top of the 
4132         * sun's disk disappears from view at an elevation similar to the mountains of Eretz Yisrael.
4133         * This time is calculated as the point at which the center of the sun's disk is 1.583 degrees below the horizon.
4134         * A method that returns a <em>shaah zmanis</em> ({@link #getTemporalHour(Date, Date) temporal hour}) calculated 
4135         * based on the <a href="https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi">Baal Hatanya</a>'s <em>netz
4136         * amiti</em> and <em>shkiah amiti</em> using a dip of 1.583&deg; below the sea level horizon. This calculation divides
4137         * the day based on the opinion of the Baal Hatanya that the day runs from {@link #getSunriseBaalHatanya() netz amiti}
4138         * to {@link #getSunsetBaalHatanya() <em>shkiah amiti</em>}. The calculations are based on a day from {@link
4139         * #getSunriseBaalHatanya() sea level <em>netz amiti</em>} to {@link #getSunsetBaalHatanya() sea level <em>shkiah amiti</em>}.
4140         * The day is split into 12 equal parts with each one being a <em>shaah zmanis</em>. This method is similar to {@link
4141         * #getTemporalHour}, but all calculations are based on a sea level sunrise and sunset.
4142         * @return the <code>long</code> millisecond length of a <em>shaah zmanis</em> calculated from
4143         *         {@link #getSunriseBaalHatanya() <em>netz amiti</em> (sunrise)} to {@link #getSunsetBaalHatanya() <em>shkiah amiti</em>
4144         *         ("real" sunset)}. If the calculation can't be computed such as in the Arctic Circle where there is at least one day a
4145         *         year where the sun does not rise, and one where it does not set, {@link Long#MIN_VALUE} will be returned. See
4146         *         detailed explanation on top of the {@link AstronomicalCalendar} documentation.
4147         * 
4148         * @see #getTemporalHour(Date, Date)
4149         * @see #getSunriseBaalHatanya()
4150         * @see #getSunsetBaalHatanya()
4151         * @see #ZENITH_1_POINT_583
4152         */
4153        public long getShaahZmanisBaalHatanya() {
4154                return getTemporalHour(getSunriseBaalHatanya(), getSunsetBaalHatanya());
4155        }
4156
4157        /**
4158         * Returns the <a href="https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi">Baal Hatanya</a>'s <em>alos</em>
4159         * (dawn) calculated as the time when the sun is 16.9&deg; below the eastern {@link #GEOMETRIC_ZENITH geometric horizon}
4160         * before {@link #getSunrise() sunrise}. For more information the source of 16.9&deg; see {@link #ZENITH_16_POINT_9}.
4161         * 
4162         * @see #ZENITH_16_POINT_9
4163         * @return The <code>Date</code> of dawn. If the calculation can't be computed such as northern and southern
4164         *         locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may not reach
4165         *         low enough below the horizon for this calculation, a <code>null</code> will be returned. See detailed
4166         *         explanation on top of the {@link AstronomicalCalendar} documentation.
4167         */
4168        public Date getAlosBaalHatanya() {
4169                return getSunriseOffsetByDegrees(ZENITH_16_POINT_9);
4170        }
4171
4172        /**
4173         * This method returns the latest <em>zman krias shema</em> (time to recite Shema in the morning). This time is 3
4174         * {@link #getShaahZmanisBaalHatanya() <em>shaos zmaniyos</em>} (solar hours) after {@link #getSunriseBaalHatanya() 
4175         * <em>netz amiti</em> (sunrise)} based on the opinion of the Baal Hatanya that the day is calculated from
4176         * sunrise to sunset. This returns the time 3 * {@link #getShaahZmanisBaalHatanya()} after {@link #getSunriseBaalHatanya() 
4177         * <em>netz amiti</em> (sunrise)}.
4178         * 
4179         * @see ZmanimCalendar#getSofZmanShma(Date, Date)
4180         * @see #getShaahZmanisBaalHatanya()
4181         * @return the <code>Date</code> of the latest <em>zman shema</em> according to the Baal Hatanya. If the calculation
4182         *         can't be computed such as in the Arctic Circle where there is at least one day a year where the sun does
4183         *         not rise, and one where it does not set, a <code>null</code> will be returned. See detailed explanation on
4184         *         top of the {@link AstronomicalCalendar} documentation.
4185         */
4186        public Date getSofZmanShmaBaalHatanya() {
4187                return getSofZmanShma(getSunriseBaalHatanya(), getSunsetBaalHatanya(), true);
4188        }
4189
4190        /**
4191         * This method returns the latest <em>zman tfilah</em> (time to recite the morning prayers). This time is 4
4192         * hours into the day based on the opinion of the Baal Hatanya that the day is
4193         * calculated from sunrise to sunset. This returns the time 4 * {@link #getShaahZmanisBaalHatanya()} after
4194         * {@link #getSunriseBaalHatanya() <em>netz amiti</em> (sunrise)}.
4195         * 
4196         * @see ZmanimCalendar#getSofZmanTfila(Date, Date)
4197         * @see #getShaahZmanisBaalHatanya()
4198         * @return the <code>Date</code> of the latest <em>zman tfilah</em>. If the calculation can't be computed such as in
4199         *         the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
4200         *         not set, a <code>null</code> will be returned. See detailed explanation on top of the
4201         *         {@link AstronomicalCalendar} documentation.
4202         */
4203        public Date getSofZmanTfilaBaalHatanya() {
4204                return getSofZmanTfila(getSunriseBaalHatanya(), getSunsetBaalHatanya(), true);
4205        }
4206
4207        /**
4208         * This method returns the latest time one is allowed eating <em>chametz</em> on <em>Erev Pesach</em> according to the
4209         * opinion of the Baal Hatanya. This time is identical to the {@link #getSofZmanTfilaBaalHatanya() <em>Sof zman
4210         * tfilah</em> Baal Hatanya}. This time is 4 hours into the day based on the opinion of the Baal Hatanya that the day
4211         * is calculated from sunrise to sunset. This returns the time 4 {@link #getShaahZmanisBaalHatanya()} after
4212         * {@link #getSunriseBaalHatanya() <em>netz amiti</em> (sunrise)}. If it is not  <em>erev Pesach</em>, a null will be
4213         * returned.
4214         * @todo in v 3.0.0 enable the calendar check for erev pesach and return <code>null</code> in all other cases.
4215         * @see #getShaahZmanisBaalHatanya()
4216         * @see #getSofZmanTfilaBaalHatanya()
4217         * @return the <code>Date</code> one is allowed eating <em>chametz</em> on <em>Erev Pesach</em>. If it is not <em>erev
4218         *         Pesach</em> or the  calculation can't be computed such as in the Arctic Circle where there is at least one
4219         *         day a year where the sun does not rise, and one where it does not set, a <code>null</code> will be returned.
4220         *         See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
4221         */
4222        public Date getSofZmanAchilasChametzBaalHatanya() {
4223                /*JewishCalendar jewishCalendar = new JewishCalendar();
4224                jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
4225                                getCalendar().get(Calendar.DAY_OF_MONTH));
4226                if (jewishCalendar.getJewishMonth() == JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() == 14) {
4227                        return getSofZmanTfilaBaalHatanya();
4228                } else {
4229                        return null;
4230                }*/
4231                return getSofZmanTfilaBaalHatanya();
4232        }
4233
4234        /**
4235         * This method returns the latest time for burning <em>chametz</em> on <em>Erev Pesach</em> according to the opinion of
4236         * the Baal Hatanya. This time is 5 hours into the day based on the opinion of the Baal Hatanya that the day is calculated
4237         * from sunrise to sunset. This returns the time 5 * {@link #getShaahZmanisBaalHatanya()} after
4238         * {@link #getSunriseBaalHatanya() <em>netz amiti</em> (sunrise)}. If it is not  <em>erev Pesach</em>, a null will be returned.
4239         * @todo in v 3.0.0 enable the calendar check for erev pesach and return <code>null</code> in all other cases.
4240         * @see #getShaahZmanisBaalHatanya()
4241         * @return the <code>Date</code> of the latest time for burning <em>chametz</em> on <em>Erev Pesach</em>.  If it is not
4242         *         <em>erev Pesach</em> or the  calculation can't be computed such as in the Arctic Circle where there is at
4243         *         least one day a year where the sun does not rise, and one where it does not set, a <code>null</code> will be
4244         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
4245         */
4246        public Date getSofZmanBiurChametzBaalHatanya() {
4247                /*JewishCalendar jewishCalendar = new JewishCalendar();
4248                jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
4249                                getCalendar().get(Calendar.DAY_OF_MONTH));
4250                if (jewishCalendar.getJewishMonth() == JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() == 14) {
4251                        return getTimeOffset(getSunriseBaalHatanya(), getShaahZmanisBaalHatanya() * 5);
4252                } else {
4253                        return null;
4254                }*/
4255                return getTimeOffset(getSunriseBaalHatanya(), getShaahZmanisBaalHatanya() * 5);
4256        }
4257
4258        /**
4259         * This method returns the time of <em>mincha gedola</em>. <em>Mincha gedola</em> is the earliest time one can pray
4260         * <em>mincha</em>. The <a href="https://en.wikipedia.org/wiki/Maimonides">Rambam</a> is of the opinion that it is
4261         * better to delay <em>mincha</em> until {@link #getMinchaKetanaBaalHatanya() <em>mincha ketana</em>} while the
4262         * <a href="https://en.wikipedia.org/wiki/Asher_ben_Jehiel">Ra"sh</a>,
4263         * <a href="https://en.wikipedia.org/wiki/Jacob_ben_Asher">Tur</a>, <a href=
4264         * "https://en.wikipedia.org/wiki/Vilna_Gaon">GRA</a> and others are of the opinion that <em>mincha</em> can be prayed
4265         * <em>lechatchila</em> starting at <em>mincha gedola</em>. This is calculated as 6.5 {@link #getShaahZmanisBaalHatanya()
4266         * sea level solar hours} after {@link #getSunriseBaalHatanya() <em>netz amiti</em> (sunrise)}. This calculation is based
4267         * on the opinion of the Baal Hatanya that the day is calculated from sunrise to sunset. This returns the time 6.5
4268         * * {@link #getShaahZmanisBaalHatanya()} after {@link #getSunriseBaalHatanya() <em>netz amiti</em> ("real" sunrise)}.
4269         * @todo Consider adjusting this to calculate the time as 30 clock or <em>zmaniyos </em> minutes after either {@link
4270         *         #getSunTransit() astronomical <em>chatzos</em>} or {@link #getChatzosAsHalfDay() <em>chatzos</em> as half a day}
4271         *         for {@link AstronomicalCalculator calculators} that support it, based on {@link #isUseAstronomicalChatzos()}.
4272         * @see #getMinchaGedola(Date, Date)
4273         * @see #getShaahZmanisBaalHatanya()
4274         * @see #getMinchaKetanaBaalHatanya()
4275         * @return the <code>Date</code> of the time of <em>mincha gedola</em> according to the Baal Hatanya. If the calculation
4276         *         can't be computed such as in the Arctic Circle where there is at least one day a year where the sun does not rise,
4277         *         and one where it does not set, a <code>null</code> will be returned. See detailed explanation on top of the
4278         *         {@link AstronomicalCalendar} documentation.
4279         */
4280        public Date getMinchaGedolaBaalHatanya() {
4281                return getMinchaGedola(getSunriseBaalHatanya(), getSunsetBaalHatanya(), true);
4282        }
4283
4284        /**
4285         * FIXME synchronous
4286         * This is a convenience method that returns the later of {@link #getMinchaGedolaBaalHatanya()} and
4287         * {@link #getMinchaGedola30Minutes()}. In the winter when 1/2 of a {@link #getShaahZmanisBaalHatanya()
4288         * <em>shaah zmanis</em>} is less than 30 minutes {@link #getMinchaGedola30Minutes()} will be returned, otherwise
4289         * {@link #getMinchaGedolaBaalHatanya()} will be returned.
4290         * @todo Consider adjusting this to calculate the time as 30 clock or <em>zmaniyos </em> minutes after either {@link
4291         *         #getSunTransit() astronomical <em>chatzos</em>} or {@link #getChatzosAsHalfDay() <em>chatzos</em> as half a day}
4292         *         for {@link AstronomicalCalculator calculators} that support it, based on {@link #isUseAstronomicalChatzos()}.
4293         * @return the <code>Date</code> of the later of {@link #getMinchaGedolaBaalHatanya()} and {@link #getMinchaGedola30Minutes()}.
4294         *         If the calculation can't be computed such as in the Arctic Circle where there is at least one day a year
4295         *         where the sun does not rise, and one where it does not set, a <code>null</code> will be returned. See detailed
4296         *         explanation on top of the {@link AstronomicalCalendar} documentation.
4297         */
4298        public Date getMinchaGedolaBaalHatanyaGreaterThan30() {
4299                if (getMinchaGedola30Minutes() == null || getMinchaGedolaBaalHatanya() == null) {
4300                        return null;
4301                } else {
4302                        return getMinchaGedola30Minutes().compareTo(getMinchaGedolaBaalHatanya()) > 0 ? getMinchaGedola30Minutes()
4303                                        : getMinchaGedolaBaalHatanya();
4304                }
4305        }
4306
4307        /**
4308         * This method returns the time of <em>mincha ketana</em>. This is the preferred earliest time to pray
4309         * <em>mincha</em> in the opinion of the <a href="https://en.wikipedia.org/wiki/Maimonides">Rambam</a> and others.
4310         * For more information on this see the documentation on {@link #getMinchaGedolaBaalHatanya() <em>mincha gedola</em>}.
4311         * This is calculated as 9.5 {@link #getShaahZmanisBaalHatanya()  sea level solar hours} after {@link #getSunriseBaalHatanya()
4312         * <em>netz amiti</em> (sunrise)}. This calculation is calculated based on the opinion of the Baal Hatanya that the
4313         * day is calculated from sunrise to sunset. This returns the time 9.5 * {@link #getShaahZmanisBaalHatanya()} after {@link
4314         * #getSunriseBaalHatanya() <em>netz amiti</em> (sunrise)}.
4315         * 
4316         * @see #getMinchaKetana(Date, Date)
4317         * @see #getShaahZmanisBaalHatanya()
4318         * @see #getMinchaGedolaBaalHatanya()
4319         * @return the <code>Date</code> of the time of <em>mincha ketana</em>. If the calculation can't be computed such as
4320         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
4321         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
4322         *         {@link AstronomicalCalendar} documentation.
4323         */
4324        public Date getMinchaKetanaBaalHatanya() {
4325                return getMinchaKetana(getSunriseBaalHatanya(), getSunsetBaalHatanya(), true);
4326        }
4327
4328        /**
4329         * This method returns the time of <em>plag hamincha</em>. This is calculated as 10.75 hours after sunrise. This
4330         * calculation is based on the opinion of the Baal Hatanya that the day is calculated
4331         * from sunrise to sunset. This returns the time 10.75 * {@link #getShaahZmanisBaalHatanya()} after
4332         * {@link #getSunriseBaalHatanya() <em>netz amiti</em> (sunrise)}.
4333         * 
4334         * @see #getPlagHamincha(Date, Date)
4335         * @return the <code>Date</code> of the time of <em>plag hamincha</em>. If the calculation can't be computed such as
4336         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
4337         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
4338         *         {@link AstronomicalCalendar} documentation.
4339         */
4340        public Date getPlagHaminchaBaalHatanya() {
4341                return getPlagHamincha(getSunriseBaalHatanya(), getSunsetBaalHatanya(), true);
4342        }
4343
4344        /**
4345         * A method that returns <em>tzais</em> (nightfall) when the sun is 6&deg; below the western geometric horizon
4346         * (90&deg;) after {@link #getSunset() sunset}. For information on the source of this calculation see
4347         * {@link #ZENITH_6_DEGREES}.
4348         * 
4349         * @return The <code>Date</code> of nightfall. If the calculation can't be computed such as northern and southern
4350         *         locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may not reach
4351         *         low enough below the horizon for this calculation, a <code>null</code> will be returned. See detailed
4352         *         explanation on top of the {@link AstronomicalCalendar} documentation.
4353         * @see #ZENITH_6_DEGREES
4354         */
4355        public Date getTzaisBaalHatanya() {
4356                return getSunsetOffsetByDegrees(ZENITH_6_DEGREES);
4357        }
4358        
4359        /**
4360         * A utility method to calculate zmanim based on <a href="https://en.wikipedia.org/wiki/Moshe_Feinstein">Rav Moshe
4361         * Feinstein</a> as calculated in <a href="https://en.wikipedia.org/wiki/Mesivtha_Tifereth_Jerusalem">MTJ</a>, <a href=
4362         * "https://en.wikipedia.org/wiki/Mesivtha_Tifereth_Jerusalem">Yeshiva of Staten Island</a>, and Camp Yeshiva
4363         * of Staten Island. The day is split in two, from <em>alos</em> / sunrise to fixed local <em>chatzos</em>, and the
4364         * second half of the day, from fixed local <em>chatzos</em> to sunset / <em>tzais</em>. Morning based times are calculated
4365         * based on the first 6 hours, and afternoon times based on the second half of the day.
4366         * @deprecated This method will be replaced in v3.0.0 by the more generic {@link
4367         *         ZmanimCalendar#getHalfDayBasedZman(Date, Date, double)} method.
4368         * 
4369         * @param startOfHalfDay
4370         *            The start of the half day. This would be <em>alos</em> or sunrise for morning based times and fixed
4371         *            local <em>chatzos</em> for the second half of the day.
4372         * @param endOfHalfDay
4373         *            The end of the half day. This would be fixed local <em>chatzos</em> for morning based times and sunset
4374         *            or <em>tzais</em> for afternoon based times.
4375         * @param hours
4376         *            the number of hours to offset the beginning of the first or second half of the day
4377         * 
4378         * @return the <code>Date</code> of the <em>zman</em> based on calculation of the first or second half of the day. If
4379         *         the calculation can't be computed such as in the Arctic Circle where there is at least one day a year where
4380         *         the sun does not rise, and one where it does not set, a <code>null</code> will be returned. See detailed
4381         *         explanation on top of the {@link AstronomicalCalendar} documentation.
4382         *
4383         * @see ComplexZmanimCalendar#getFixedLocalChatzos()
4384         * @see ZmanimCalendar#getHalfDayBasedZman(Date, Date, double)
4385         */
4386        @Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
4387        public Date getFixedLocalChatzosBasedZmanim(Date startOfHalfDay, Date endOfHalfDay, double hours) {
4388                return getHalfDayBasedZman(startOfHalfDay, endOfHalfDay, hours);
4389        }
4390        
4391        /**
4392         * This method returns <a href="https://en.wikipedia.org/wiki/Moshe_Feinstein">Rav Moshe Feinstein's</a> opinion of the
4393         * calculation of <em>sof zman krias shema</em> (latest time to recite <em>Shema</em> in the morning) according to the
4394         * opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> that the
4395         * day is calculated from dawn to nightfall, but calculated using the first half of the day only. The half a day starts
4396         * at <em>alos</em> defined as {@link #getAlos18Degrees() 18&deg;} and ends at {@link #getFixedLocalChatzos() fixed local
4397         * chatzos}. <em>Sof Zman Shema</em> is 3 <em>shaos zmaniyos</em> (solar hours) after <em>alos</em> or half of this half-day.
4398         * 
4399         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
4400         *         as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
4401         *         where the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be
4402         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
4403         * @see #getAlos18Degrees()
4404         * @see #getFixedLocalChatzos()
4405         * @see ZmanimCalendar#getHalfDayBasedZman(Date, Date, double)
4406         */
4407        public Date getSofZmanShmaMGA18DegreesToFixedLocalChatzos() {
4408                return getHalfDayBasedZman(getAlos18Degrees(), getFixedLocalChatzos(), 3);
4409        }
4410        
4411        /**
4412         * This method returns <a href="https://en.wikipedia.org/wiki/Moshe_Feinstein">Rav Moshe Feinstein's</a> opinion of the
4413         * calculation of <em>sof zman krias shema</em> (latest time to recite <em>Shema</em> in the morning) according to the
4414         * opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> that the
4415         * day is calculated from dawn to nightfall, but calculated using the first half of the day only. The half a day starts
4416         * at <em>alos</em> defined as {@link #getAlos16Point1Degrees() 16.1&deg;} and ends at {@link #getFixedLocalChatzos() fixed local
4417         * chatzos}. <em>Sof Zman Shema</em> is 3 <em>shaos zmaniyos</em> (solar hours) after this <em>alos</em> or half of this half-day.
4418         * 
4419         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
4420         *         as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
4421         *         where the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be returned.
4422         *         See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
4423         * @see #getAlos16Point1Degrees()
4424         * @see #getFixedLocalChatzos()
4425         * @see #getHalfDayBasedZman(Date, Date, double)
4426         */
4427        public Date getSofZmanShmaMGA16Point1DegreesToFixedLocalChatzos() {
4428                return getHalfDayBasedZman(getAlos16Point1Degrees(), getFixedLocalChatzos(), 3);
4429        }
4430        
4431        /**
4432         * This method returns <a href="https://en.wikipedia.org/wiki/Moshe_Feinstein">Rav Moshe Feinstein's</a> opinion of the
4433         * calculation of <em>sof zman krias shema</em> (latest time to recite <em>Shema</em> in the morning) according to the
4434         * opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> that the
4435         * day is calculated from dawn to nightfall, but calculated using the first half of the day only. The half a day starts
4436         * at <em>alos</em> defined as {@link #getAlos90() 90 minutes before sunrise} and ends at {@link #getFixedLocalChatzos()
4437         * fixed local chatzos}. <em>Sof Zman Shema</em> is 3 <em>shaos zmaniyos</em> (solar hours) after this <em>alos</em> or
4438         * half of this half-day.
4439         * 
4440         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
4441         *         as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
4442         *         where the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be
4443         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
4444         * @see #getAlos90()
4445         * @see #getFixedLocalChatzos()
4446         * @see #getHalfDayBasedZman(Date, Date, double)
4447         */
4448        public Date getSofZmanShmaMGA90MinutesToFixedLocalChatzos() {
4449                return getHalfDayBasedZman(getAlos90(), getFixedLocalChatzos(), 3);
4450        }
4451        
4452        /**
4453         * This method returns <a href="https://en.wikipedia.org/wiki/Moshe_Feinstein">Rav Moshe Feinstein's</a> opinion of the
4454         * calculation of <em>sof zman krias shema</em> (latest time to recite <em>Shema</em> in the morning) according to the
4455         * opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> that the
4456         * day is calculated from dawn to nightfall, but calculated using the first half of the day only. The half a day starts
4457         * at <em>alos</em> defined as {@link #getAlos72() 72 minutes before sunrise} and ends at {@link #getFixedLocalChatzos()
4458         * fixed local chatzos}. <em>Sof Zman Shema</em> is 3 <em>shaos zmaniyos</em> (solar hours) after this <em>alos</em> or
4459         * half of this half-day.
4460         * 
4461         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
4462         *         as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
4463         *         where the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be
4464         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
4465         * @see #getAlos72()
4466         * @see #getFixedLocalChatzos()
4467         * @see #getHalfDayBasedZman(Date, Date, double)
4468         */
4469        public Date getSofZmanShmaMGA72MinutesToFixedLocalChatzos() {
4470                return getHalfDayBasedZman(getAlos72(), getFixedLocalChatzos(), 3);
4471        }
4472                
4473        /**
4474         * This method returns <a href="https://en.wikipedia.org/wiki/Moshe_Feinstein">Rav Moshe Feinstein's</a> opinion of the
4475         * calculation of <em>sof zman krias shema</em> (latest time to recite <em>Shema</em> in the morning) according to the
4476         * opinion of the <a href="https://en.wikipedia.org/wiki/Vilna_Gaon">GRA</a> that the day is calculated from
4477         * sunrise to sunset, but calculated using the first half of the day only. The half a day starts at {@link #getSunrise()
4478         * sunrise} and ends at {@link #getFixedLocalChatzos() fixed local chatzos}. <em>Sof zman Shema</em> is 3 <em>shaos
4479         * zmaniyos</em> (solar hours) after sunrise or half of this half-day.
4480         * 
4481         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
4482         *         as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
4483         *         where the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be
4484         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
4485         * @see #getSunrise()
4486         * @see #getFixedLocalChatzos()
4487         * @see #getHalfDayBasedZman(Date, Date, double)
4488         */
4489        public Date getSofZmanShmaGRASunriseToFixedLocalChatzos() {
4490                return getHalfDayBasedZman(getElevationAdjustedSunrise(), getFixedLocalChatzos(), 3);
4491        }
4492        
4493        /**
4494         * This method returns <a href="https://en.wikipedia.org/wiki/Moshe_Feinstein">Rav Moshe Feinstein's</a> opinion of the
4495         * calculation of <em>sof zman tfila</em> (<em>zman tfilah</em> (the latest time to recite the morning prayers))
4496         * according to the opinion of the <a href="https://en.wikipedia.org/wiki/Vilna_Gaon">GRA</a> that the day is
4497         * calculated from sunrise to sunset, but calculated using the first half of the day only. The half a day starts at
4498         * {@link #getSunrise() sunrise} and ends at {@link #getFixedLocalChatzos() fixed local chatzos}. <em>Sof zman tefila</em>
4499         * is 4 <em>shaos zmaniyos</em> (solar hours) after sunrise or 2/3 of this half-day.
4500         * 
4501         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
4502         *         as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
4503         *         where the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be
4504         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
4505         * @see #getSunrise()
4506         * @see #getFixedLocalChatzos()
4507         * @see #getHalfDayBasedZman(Date, Date, double)
4508         */
4509        public Date getSofZmanTfilaGRASunriseToFixedLocalChatzos() {
4510                return getHalfDayBasedZman(getElevationAdjustedSunrise(), getFixedLocalChatzos(), 4);
4511        }
4512        
4513        /**
4514         * This method returns <a href="https://en.wikipedia.org/wiki/Moshe_Feinstein">Rav Moshe Feinstein's</a> opinion of
4515         * the calculation of <em>mincha gedola</em>, the earliest time one can pray <em>mincha</em> <a href=
4516         * "https://en.wikipedia.org/wiki/Vilna_Gaon">GRA</a> that is 30 minutes after {@link #getFixedLocalChatzos() fixed
4517         * local chatzos}.
4518         * 
4519         * @return the <code>Date</code> of the time of <em>mincha gedola</em>. If the calculation can't be computed such as
4520         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
4521         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
4522         *         {@link AstronomicalCalendar} documentation.
4523         * 
4524         * @see #getMinchaGedola()
4525         * @see #getFixedLocalChatzos()
4526         * @see #getMinchaKetanaGRAFixedLocalChatzosToSunset
4527         */
4528        public Date getMinchaGedolaGRAFixedLocalChatzos30Minutes() {
4529                return getTimeOffset(getFixedLocalChatzos(), MINUTE_MILLIS * 30);
4530        }
4531        
4532        /**
4533         * This method returns <a href="https://en.wikipedia.org/wiki/Moshe_Feinstein">Rav Moshe Feinstein's</a> opinion
4534         * of the calculation of <em>mincha ketana</em> (the preferred time to recite the <em>mincha prayers</em> according to
4535         * the opinion of the <a href="https://en.wikipedia.org/wiki/Maimonides">Rambam</a> and others) calculated according
4536         * to the <a href="https://en.wikipedia.org/wiki/Vilna_Gaon">GRA</a> that is 3.5 <em>shaos zmaniyos</em> (solar
4537         * hours) after {@link #getFixedLocalChatzos() fixed local chatzos}.
4538         * 
4539         * @return the <code>Date</code> of the time of <em>mincha gedola</em>. If the calculation can't be computed such as
4540         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
4541         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
4542         *         {@link AstronomicalCalendar} documentation.
4543         *         
4544         * @see #getMinchaGedola()
4545         * @see #getFixedLocalChatzos()
4546         * @see #getMinchaGedolaGRAFixedLocalChatzos30Minutes
4547         * @see ZmanimCalendar#getHalfDayBasedZman(Date, Date, double)
4548         */
4549        public Date getMinchaKetanaGRAFixedLocalChatzosToSunset() {
4550                return getHalfDayBasedZman(getFixedLocalChatzos(), getElevationAdjustedSunset(), 3.5);
4551        }
4552        
4553        /**
4554         * This method returns <a href="https://en.wikipedia.org/wiki/Moshe_Feinstein">Rav Moshe Feinstein's</a> opinion
4555         * of the calculation of <em>plag hamincha</em>. This method returns <em>plag hamincha</em> calculated according to the
4556         * <a href="https://en.wikipedia.org/wiki/Vilna_Gaon">GRA</a> that the day ends at sunset and is 4.75 <em>shaos
4557         * zmaniyos</em> (solar hours) after {@link #getFixedLocalChatzos() fixed local chatzos}.
4558         * 
4559         * @return the <code>Date</code> of the time of <em>mincha gedola</em>. If the calculation can't be computed such as
4560         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
4561         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
4562         *         {@link AstronomicalCalendar} documentation.
4563         *         
4564         * @see #getPlagHamincha()
4565         * @see #getFixedLocalChatzos()
4566         * @see #getMinchaKetanaGRAFixedLocalChatzosToSunset
4567         * @see #getMinchaGedolaGRAFixedLocalChatzos30Minutes
4568         * @see ZmanimCalendar#getHalfDayBasedZman(Date, Date, double)
4569         */
4570        public Date getPlagHaminchaGRAFixedLocalChatzosToSunset() {
4571                return getHalfDayBasedZman(getFixedLocalChatzos(), getElevationAdjustedSunset(), 4.75);
4572        }
4573        
4574        /**
4575         * Method to return <em>tzais</em> (dusk) calculated as 50 minutes after sea level sunset. This method returns
4576         * <em>tzais</em> (nightfall) based on the opinion of Rabbi Moshe Feinstein for the New York area. This time should
4577         * not be used for latitudes other than ones similar to the latitude of the NY area.
4578         * 
4579         * @return the <code>Date</code> representing the time. If the calculation can't be computed such as in the Arctic
4580         *         Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
4581         *         a <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
4582         *         documentation.
4583         */
4584        public Date getTzais50() {
4585                return getTimeOffset(getElevationAdjustedSunset(), 50 * MINUTE_MILLIS);
4586        }
4587        
4588        /**
4589         * A method for calculating <em>samuch lemincha ketana</em>, / near <em>mincha ketana</em> time that is half an hour before
4590         * {@link #getMinchaKetana()} or is 9 * {@link #getShaahZmanisGra() <em>shaos zmaniyos</em>} (solar hours) after {@link
4591         * #getSunrise() sunrise} or {@link #getSeaLevelSunrise() sea level sunrise} (depending on the {@link #isUseElevation()}
4592         * setting), calculated according to the <a href="https://en.wikipedia.org/wiki/Vilna_Gaon">GRA</a> using a day starting at
4593         * sunrise and ending at sunset. This is the time that eating or other activity can't begin prior to praying <em>mincha</em>.
4594         * The calculation used is 9 * {@link #getShaahZmanis16Point1Degrees()} after {@link #getAlos16Point1Degrees() <em>alos</em>
4595         * 16.1&deg;}. See the <a href="https://hebrewbooks.org/pdfpager.aspx?req=60387&st=&pgnum=294">Mechaber and Mishna Berurah
4596         * 232</a> and <a href="https://hebrewbooks.org/pdfpager.aspx?req=60388&pgnum=34">249:2</a>.
4597         * 
4598         * @see #getShaahZmanisGra()
4599         * @see #getSamuchLeMinchaKetana16Point1Degrees()
4600         * @see #isUseAstronomicalChatzosForOtherZmanim()
4601         * @return the <code>Date</code> of the time of <em>samuch lemincha ketana</em>. If the calculation can't be computed such
4602         *         as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
4603         *         where the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be
4604         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
4605         */
4606        public Date getSamuchLeMinchaKetanaGRA() {
4607                return getSamuchLeMinchaKetana(getElevationAdjustedSunrise(), getElevationAdjustedSunset(), true);
4608        }
4609        
4610        /**
4611         * A method for calculating <em>samuch lemincha ketana</em>, / near <em>mincha ketana</em> time that is half an hour
4612         * before {@link #getMinchaGedola16Point1Degrees()}  or 9 * <em>shaos zmaniyos</em> (temporal hours) after the start of
4613         * the day, calculated using a day starting and ending 16.1&deg; below the horizon. This is the time that eating or other
4614         * activity can't begin prior to praying <em>mincha</em>. The calculation used is 9 * {@link
4615         * #getShaahZmanis16Point1Degrees()} after {@link #getAlos16Point1Degrees() <em>alos</em> 16.1&deg;}. See the <a href=
4616         * "https://hebrewbooks.org/pdfpager.aspx?req=60387&st=&pgnum=294">Mechaber and Mishna Berurah 232</a> and <a href=
4617         * "https://hebrewbooks.org/pdfpager.aspx?req=60388&pgnum=34">249:2</a>.
4618         * 
4619         * @see #getShaahZmanis16Point1Degrees()
4620         * @return the <code>Date</code> of the time of <em>samuch lemincha ketana</em>. If the calculation can't be computed such
4621         *         as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
4622         *         where the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be returned.
4623         *         See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
4624         */
4625        public Date getSamuchLeMinchaKetana16Point1Degrees() {
4626                return getSamuchLeMinchaKetana(getAlos16Point1Degrees(), getTzais16Point1Degrees(), true);
4627        }
4628        
4629        /**
4630         * A method for calculating <em>samuch lemincha ketana</em>, / near <em>mincha ketana</em> time that is half an hour before
4631         * {@link #getMinchaKetana72Minutes()}  or 9 * <em>shaos zmaniyos</em> (temporal hours) after the start of the day,
4632         * calculated using a day starting 72 minutes before sunrise and ending 72 minutes after sunset. This is the time that eating
4633         * or other activity can't begin prior to praying <em>mincha</em>. The calculation used is 9 * {@link
4634         * #getShaahZmanis16Point1Degrees()} after {@link #getAlos16Point1Degrees() <em>alos</em> 16.1&deg;}. See the <a href=
4635         * "https://hebrewbooks.org/pdfpager.aspx?req=60387&st=&pgnum=294">Mechaber and Mishna Berurah 232</a> and <a href=
4636         * "https://hebrewbooks.org/pdfpager.aspx?req=60388&pgnum=34">249:2</a>.
4637         * 
4638         * @see #getShaahZmanis16Point1Degrees()
4639         * @return the <code>Date</code> of the time of <em>samuch lemincha ketana</em>. If the calculation can't be computed such
4640         *         as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
4641         *         where the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be returned.
4642         *         See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
4643         */
4644        public Date getSamuchLeMinchaKetana72Minutes() {
4645                return getSamuchLeMinchaKetana(getAlos72(), getTzais72(), true);
4646        }
4647        
4648        /**
4649         * This method returns the time for <em>tzais hacochavim</em> (nightfall) according to the opinion of the Geonim,
4650         * calculated as 13.5 minutes <em>zmaniyos</em> (based on 3/4 of an 18-minute <em>mil</em> after sunset. This is a
4651         * very early <em>zman</em> mentioned in the Yalkut Yosef on <a href=
4652         * "https://hebrewbooks.org/pdfpager.aspx?req=56810&st=&pgnum=247">Hilchos Chanukah siman 672</a>, and it should not
4653         * be used without <em>halachic</em> guidance! It certainly should never be used for the end of <em>Shabbos</em>. To
4654         * illustrate how short the time can be between sunset and this <em>tzais</em>, calculations at the winter solstice
4655         * (when the day is shortest) show that it occurs as 11 minutes and 20 seconds after sunset in Yerushalayim, 10
4656         * minutes and 19 seconds in Lakewood, NJ, 9 minutes and 47 seconds in Montreal and only 8 minutes and 5 seconds after
4657         * sunset in Gateshead, England. Conversely, at the summer solstice the times will be longer than 13.5 minutes.
4658         *
4659         * @deprecated This is a very early <em>zman</em>, and it should not be used without <em>halachic</em> guidance. It
4660         *         should never be used for calculaing the end of <em>Shabbos</em>.
4661         * @return the <code>Date</code> of the time of <em>tzais</em>.  If the calculation can't be computed such as in
4662         *         the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
4663         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the {@link
4664         *         AstronomicalCalendar} documentation.
4665         * @see #getTzaisGeonimYalkutYosef20MinutesZmanis()
4666         */
4667        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
4668        public Date getTzaisGeonimYalkutYosef13Point5MinutesZmanis() {
4669                return getZmanisBasedOffset(13.5 / 60); // 13.5 minutes zmaniyos after sunset
4670        }
4671        
4672        /**
4673         * This method returns the time for <em>tzais hacochavim</em> (nightfall) according to the opinion of the Geonim,
4674         * calculated as 20 minutes <em>zmaniyos</em> after sunset. This is a very early <em>zman</em>, and it should not be
4675         * used without <em>halachic</em> guidance! It certainly should never be used for the end of <em>Shabbos</em>.
4676         * FIXME - add more documentation
4677         * @todo sources.
4678         * @return the <code>Date</code> of the time of <em>tzais</em>.  If the calculation can't be computed such as in
4679         *         the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
4680         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the {@link
4681         *         AstronomicalCalendar} documentation.
4682         *  @see #getTzaisGeonimYalkutYosef13Point5MinutesZmanis()
4683         */
4684        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
4685        public Date getTzaisGeonimYalkutYosef20MinutesZmanis() {
4686                return getZmanisBasedOffset(20.0 / 60); // 20 minutes zmaniyos after sunset
4687        }
4688        
4689        /**
4690         * A method for calculating <em>plag hamincha</em> based on the calculations of the Yalkut Yosef. This calculation
4691         * subtracts 1.25 <em>shaaos zmaniyos</em> from sunrise to sunset (elevation adjusted if {@link #isUseElevation()}
4692         * is set to true) from {@link #getTzaisGeonimYalkutYosef13Point5MinutesZmanis()}.
4693         * 
4694         * @return the <code>Date</code> of the time of <em>plag hamincha</em>. If the calculation can't be computed such as
4695         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
4696         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the {@link
4697         *         AstronomicalCalendar} documentation.
4698         * @see #getTzaisGeonimYalkutYosef13Point5MinutesZmanis()
4699         * @see #getShaahZmanisGra()
4700         * FIXME sources.
4701         * @todo sources
4702         */
4703        public Date getPlagHaminchaYalkutYosef() {
4704                return getTimeOffset(getTzaisGeonimYalkutYosef13Point5MinutesZmanis(), - (getShaahZmanisGra() * 1.25));
4705        }
4706        
4707        /**
4708         * This method returns the time for <em>misheyakir</em> calculated as 66 minutes <em>zmaniyos</em> before sunrise
4709         * following the calculation used in the Ohr Hachaim calendar based on Rav Ovadya Yosef in Yechave Daat 2:8. The
4710         * 66 minutes is based on the Pri Megadim in Eishel Avraham 58:2. This is a very early zman, and it should not be
4711         * used without <em>halachic</em> guidance.
4712         * 
4713         * @deprecated This is a very early <em>zman</em>, and it should not be used without <em>halachic</em> guidance.
4714         * 
4715         * @return the <code>Date</code> of the time of <em>misheyakir</em>. If the calculation can't be computed such as in
4716         *         the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
4717         *         not set, a <code>null</code> will be returned. See detailed explanation on top of the {@link
4718         *         AstronomicalCalendar} documentation.
4719         */
4720        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
4721        public Date getMisheyakirYalkutYosef66MinutesZmanis() {
4722                return getZmanisBasedOffset(-1.1); // 66 minutes zmaniyos (1.1 hours) before sunrise
4723        }
4724}