001/*
002 * Zmanim Java API
003 * Copyright (C) 2004-2026 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 - 2026
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;). This 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 degree equivalent to 60 minutes before sunrise,
1150         * when in fact at that point the sun is about 13.5&deg; below the horizon). The 57 minute based time is mentioned by the
1151         * Minchas Yitzchak <a href="https://hebrewbooks.org/pdfpager.aspx?req=1601&st=&pgnum=21">vol. 9, siman 9</a> as 15 minutes
1152         * before <em>alos hashachar</em> (though he is not clear what location he refers to, and does not mention a degree-based
1153         * conversion). The Kaf Hachaim <a href="https://hebrewbooks.org/pdfpager.aspx?req=8140&st=&pgnum=81">vol.1 siman 18, no.
1154         * 18</a> states that in Yerushalayim 60 fixed minutes are used year round. Calculations show that 60 fixed minutes in
1155         * Yerushalayim ranges from 13.5&deg; at the spring equinox to 11.5&deg; at the summer solstice. 57 minutes range from
1156         * 12.9&deg; at the winter equinox to 11&deg; at the summer solstice.
1157         * Analysis of the difference between 12.85&deg; and 12.9&deg;, shows that the maximum difference occurs at the summer
1158         * solstice. In Lakewood, NJ at a latitude of 40.096&deg;, the maximum difference throughout the year is 23 seconds.
1159         * In the winter where there is the greatest need for very early <em>misheyakir</em> times, the difference is in the 16
1160         * second range. Going north to Montreal at latitude 45.5&deg;, the maximum is 29 seconds and is about 18 seconds in the
1161         * winter. Moving farther north to the elevation of Vilnius at a latitude of 54.68&deg;, things change. Firstly, around the
1162         * summer solstice it will not reach that far below the horizon. On the dates that both can be calculated, the maximum
1163         * difference can be pretty high on one or two days of the year (around Jul 8),  with about a week having over a two minute
1164         * difference between the two. Even at the latitude of Vilna, from Dec - March, the difference is about 22 seconds.
1165         * 
1166         * @deprecated This method returns a very early <em>misheyakir</em> time that should only be used <b><em>bish'as
1167         *         hadchak</em></b>. <em>Lechatchila</em>, a later <em>zman</em> should be used. There is no current plan to remove
1168         *         this method from the API, and this deprecation is intended to notify developers to add an alert to users of
1169         *         the risk of using it.
1170         * 
1171         * @return The <code>Date</code> of <em>misheyakir</em>. If the calculation can't be computed such as northern and
1172         *         southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may
1173         *         not reach low enough below the horizon for this calculation, a <code>null</code> will be returned. See
1174         *         detailed explanation on top of the {@link AstronomicalCalendar} documentation.
1175         * @see #ZENITH_12_POINT_85
1176         */
1177        @Deprecated(forRemoval = false) // add back once Java 9 is the minimum supported version
1178        public Date getMisheyakir12Point85Degrees() {
1179                return getSunriseOffsetByDegrees(ZENITH_12_POINT_85);
1180        }
1181
1182        /**
1183         * This method returns <em>misheyakir</em> based on the position of the sun when it is {@link #ZENITH_11_DEGREES
1184         * 11.5&deg;} below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is used for calculating
1185         * <em>misheyakir</em> according to some opinions. This calculation is based on the position of the sun 52 minutes
1186         * before {@link #getSunrise() sunrise} in Jerusalem <a href=
1187         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a>,
1188         * which calculates to 11.5&deg; below {@link #GEOMETRIC_ZENITH geometric zenith}.
1189         * @todo recalculate.
1190         * 
1191         * @return the <code>Date</code> of <em>misheyakir</em>. If the calculation can't be computed such as northern and
1192         *         southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may
1193         *         not reach low enough below the horizon for this calculation, a <code>null</code> will be returned. See
1194         *         detailed explanation on top of the {@link AstronomicalCalendar} documentation.
1195         * @see #ZENITH_11_POINT_5
1196         */
1197        public Date getMisheyakir11Point5Degrees() {
1198                return getSunriseOffsetByDegrees(ZENITH_11_POINT_5);
1199        }
1200
1201        /**
1202         * This method returns <em>misheyakir</em> based on the position of the sun when it is {@link #ZENITH_11_DEGREES
1203         * 11&deg;} below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is used for calculating
1204         * <em>misheyakir</em> according to some opinions. This calculation is based on the position of the sun 48 minutes
1205         * before {@link #getSunrise() sunrise} in Jerusalem <a href=
1206         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a>,
1207         * which calculates to 11&deg; below {@link #GEOMETRIC_ZENITH geometric zenith}.
1208         * 
1209         * @return If the calculation can't be computed such as northern and southern locations even south of the Arctic
1210         *         Circle and north of the Antarctic Circle where the sun may not reach low enough below the horizon for
1211         *         this calculation, a <code>null</code> will be returned. See detailed explanation on top of the
1212         *         {@link AstronomicalCalendar} documentation.
1213         * @see #ZENITH_11_DEGREES
1214         */
1215        public Date getMisheyakir11Degrees() {
1216                return getSunriseOffsetByDegrees(ZENITH_11_DEGREES);
1217        }
1218
1219        /**
1220         * This method returns <em>misheyakir</em> based on the position of the sun when it is {@link #ZENITH_10_POINT_2
1221         * 10.2&deg;} below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is used for calculating
1222         * <em>misheyakir</em> according to some opinions. This calculation is based on the position of the sun 45 minutes
1223         * before {@link #getSunrise() sunrise} in Jerusalem <a href=
1224         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox</a> which calculates
1225         * to 10.2&deg; below {@link #GEOMETRIC_ZENITH geometric zenith}.
1226         * 
1227         * @return the <code>Date</code> of <em>misheyakir</em>. If the calculation can't be computed such as
1228         *         northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle where
1229         *         the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be returned
1230         *         See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
1231         * @see #ZENITH_10_POINT_2
1232         */
1233        public Date getMisheyakir10Point2Degrees() {
1234                return getSunriseOffsetByDegrees(ZENITH_10_POINT_2);
1235        }
1236        
1237        /**
1238         * This method returns <em>misheyakir</em> based on the position of the sun when it is {@link #ZENITH_7_POINT_65
1239         * 7.65&deg;} below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). The degrees are based on a 35/36 minute
1240         * <em>zman</em> <a href="https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the
1241         * equinox / equilux</a>, when the <em>neshef</em> (twilight) is the shortest. This time is based on <a href=
1242         * "https://en.wikipedia.org/wiki/Moshe_Feinstein">Rabbi Moshe Feinstein</a> who writes in <a href=
1243         * "https://hebrewbooks.org/pdfpager.aspx?req=14677&pgnum=7">Ohr Hachaim Vol. 4, Ch. 6</a>
1244         * that <em>misheyakir</em> in New York is 35-40 minutes before sunrise, something that is a drop less than 8&deg;.
1245         * <a href="https://en.wikipedia.org/wiki/Yisroel_Taplin">Rabbi Yisroel Taplin</a> in <a href=
1246         * "https://www.worldcat.org/oclc/889556744">Zmanei Yisrael</a> (page 117) notes that <a href=
1247         * "https://en.wikipedia.org/wiki/Yaakov_Kamenetsky">Rabbi Yaakov Kamenetsky</a> stated that it is not less than 36
1248         * minutes before sunrise (maybe it is 40 minutes). Sefer Yisrael Vehazmanim (p. 7) quotes the Tamar Yifrach
1249         * in the name of the <a href="https://en.wikipedia.org/wiki/Joel_Teitelbaum">Satmar Rov</a> that one should be stringent
1250         * not consider <em>misheyakir</em> before 36 minutes. This is also the accepted <a href=
1251         * "https://en.wikipedia.org/wiki/Minhag">minhag</a> in <a href=
1252         * "https://en.wikipedia.org/wiki/Lakewood_Township,_New_Jersey">Lakewood</a> that is used in the <a href=
1253         * "https://en.wikipedia.org/wiki/Beth_Medrash_Govoha">Yeshiva</a>. This follows the opinion of <a href=
1254         * "https://en.wikipedia.org/wiki/Shmuel_Kamenetsky">Rabbi Shmuel Kamenetsky</a> who provided the time of 35/36 minutes,
1255         * but did not provide a degree-based time. Since this <em>zman</em> depends on the level of light, Rabbi Yaakov Shakow
1256         * presented this degree-based calculations to Rabbi Shmuel Kamenetsky who agreed to them.
1257         * 
1258         * @return the <code>Date</code> of <em>misheyakir</em>. If the calculation can't be computed such as
1259         *         northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle where
1260         *         the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be returned.
1261         *         See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
1262         * 
1263         * @see #ZENITH_7_POINT_65
1264         * @see #getMisheyakir9Point5Degrees()
1265         */
1266        public Date getMisheyakir7Point65Degrees() {
1267                return getSunriseOffsetByDegrees(ZENITH_7_POINT_65);
1268        }
1269        
1270        /**
1271         * This method returns <em>misheyakir</em> based on the position of the sun when it is {@link #ZENITH_9_POINT_5
1272         * 9.5&deg;} below {@link #GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is based on <a href=
1273         * "https://en.wikipedia.org/wiki/Dovid_Kronglas">Rabbi Dovid Kronglass's</a> Calculation of 45 minutes in Baltimore
1274         * as mentioned in <a href="https://hebrewbooks.org/pdfpager.aspx?req=20287&pgnum=29">Divrei Chachamim No. 24</a>
1275         * brought down by the <a href="https://hebrewbooks.org/pdfpager.aspx?req=50535&pgnum=87">Birur Halacha, Tinyana, Ch.
1276         * 18</a>. This calculates to 9.5&deg;. Also see <a href="https://en.wikipedia.org/wiki/Jacob_Isaac_Neiman">Rabbi Yaakov
1277         * Yitzchok Neiman</a> in Kovetz Eitz Chaim Vol. 9, p. 202 that the Vya'an Yosef did not want to rely on times earlier
1278         * than 45 minutes in New York. This <em>zman</em> is also used in the calendars published by Rabbi Hershel Edelstein.
1279         * As mentioned in Yisroel Vehazmanim, Rabbi Edelstein who was given the 45 minute <em>zman</em> by Rabbi Bick. The
1280         * calendars published by the <em><a href="https://en.wikipedia.org/wiki/Mizrahi_Jews">Edot Hamizrach</a></em> communities
1281         * also use this <em>zman</em>. This also follows the opinion of <a href="https://en.wikipedia.org/wiki/Shmuel_Kamenetsky"
1282         * >Rabbi Shmuel Kamenetsky</a> who provided the time of 36 and 45 minutes, but did not provide a degree-based time. Since
1283         * this <em>zman</em> depends on the level of light, Rabbi Yaakov Shakow presented these degree-based times to Rabbi Shmuel
1284         * Kamenetsky who agreed to them.
1285         * 
1286         * @return the <code>Date</code> of <em>misheyakir</em>. If the calculation can't be computed such as
1287         *         northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle where
1288         *         the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be returned.
1289         *         See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
1290         * 
1291         * @see #ZENITH_9_POINT_5
1292         * @see #getMisheyakir7Point65Degrees()
1293         */
1294        public Date getMisheyakir9Point5Degrees() {
1295                return getSunriseOffsetByDegrees(ZENITH_9_POINT_5);
1296        }
1297
1298        /**
1299         * This method returns the latest <em>zman krias shema</em> (time to recite Shema in the morning) according to the
1300         * opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on
1301         * <em>alos</em> being {@link #getAlos19Point8Degrees() 19.8&deg;} before {@link #getSunrise() sunrise}. This
1302         * time is 3 {@link #getShaahZmanis19Point8Degrees() <em>shaos zmaniyos</em>} (solar hours) after {@link
1303         * #getAlos19Point8Degrees() dawn} based on the opinion of the MGA that the day is calculated from dawn to nightfall
1304         * with both being 19.8&deg; below sunrise or sunset. This returns the time of 3 *
1305         * {@link #getShaahZmanis19Point8Degrees()} after {@link #getAlos19Point8Degrees() dawn}.
1306         * 
1307         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1308         *         as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
1309         *         where the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be
1310         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
1311         * @see #getShaahZmanis19Point8Degrees()
1312         * @see #getAlos19Point8Degrees()
1313         */
1314        public Date getSofZmanShmaMGA19Point8Degrees() {
1315                return getSofZmanShma(getAlos19Point8Degrees(), getTzais19Point8Degrees(), true);
1316        }
1317
1318        /**
1319         * This method returns the latest <em>zman krias shema</em> (time to recite Shema in the morning) according to the
1320         * opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based
1321         * on <em>alos</em> being {@link #getAlos16Point1Degrees() 16.1&deg;} before {@link #getSunrise() sunrise}. This time
1322         * is 3 {@link #getShaahZmanis16Point1Degrees() <em>shaos zmaniyos</em>} (solar hours) after
1323         * {@link #getAlos16Point1Degrees() dawn} based on the opinion of the MGA that the day is calculated from
1324         * dawn to nightfall with both being 16.1&deg; below sunrise or sunset. This returns the time of
1325         * 3 * {@link #getShaahZmanis16Point1Degrees()} after {@link #getAlos16Point1Degrees() dawn}.
1326         * 
1327         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1328         *         as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
1329         *         where the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be
1330         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
1331         * @see #getShaahZmanis16Point1Degrees()
1332         * @see #getAlos16Point1Degrees()
1333         */
1334        public Date getSofZmanShmaMGA16Point1Degrees() {
1335                return getSofZmanShma(getAlos16Point1Degrees(), getTzais16Point1Degrees(), true);
1336        }
1337
1338        /**
1339         * This method returns the latest <em>zman krias shema</em> (time to recite Shema in the morning) according to the
1340         * opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based
1341         * on <em>alos</em> being {@link #getAlos18Degrees() 18&deg;} before {@link #getSunrise() sunrise}. This time is 3
1342         * {@link #getShaahZmanis18Degrees() <em>shaos zmaniyos</em>} (solar hours) after {@link #getAlos18Degrees() dawn}
1343         * based on the opinion of the MGA that the day is calculated from dawn to nightfall with both being 18&deg;
1344         * below sunrise or sunset. This returns the time of 3 * {@link #getShaahZmanis18Degrees()} after
1345         * {@link #getAlos18Degrees() dawn}.
1346         * 
1347         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1348         *         as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
1349         *         where the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be
1350         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
1351         * @see #getShaahZmanis18Degrees()
1352         * @see #getAlos18Degrees()
1353         */
1354        public Date getSofZmanShmaMGA18Degrees() {
1355                return getSofZmanShma(getAlos18Degrees(), getTzais18Degrees(), true);
1356        }
1357
1358        /**
1359         * This method returns the latest <em>zman krias shema</em> (time to recite Shema in the morning) according to the
1360         * opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on
1361         * <em>alos</em> being {@link #getAlos72() 72} minutes before {@link #getSunrise() sunrise}. This time is 3 {@link
1362         * #getShaahZmanis72Minutes() <em>shaos zmaniyos</em>} (solar hours) after {@link #getAlos72() dawn} based on the opinion
1363         * of the MGA that the day is calculated from a {@link #getAlos72() dawn} of 72 minutes before sunrise to
1364         * {@link #getTzais72() nightfall} of 72 minutes after sunset. This returns the time of 3 * {@link
1365         * #getShaahZmanis72Minutes()} after {@link #getAlos72() dawn}. This class returns an identical time to {@link
1366         * #getSofZmanShmaMGA()} and is repeated here for clarity.
1367         * 
1368         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1369         *         as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
1370         *         it does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1371         *         {@link AstronomicalCalendar} documentation.
1372         * @see #isUseAstronomicalChatzosForOtherZmanim()
1373         * @see #getShaahZmanis72Minutes()
1374         * @see #getAlos72()
1375         * @see #getSofZmanShmaMGA()
1376         */
1377        public Date getSofZmanShmaMGA72Minutes() {
1378                return getSofZmanShmaMGA();
1379        }
1380
1381        /**
1382         * This method returns the latest <em>zman krias shema</em> (time to recite <em>Shema</em> in the morning) according
1383         * to the opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based
1384         * on <em>alos</em> being {@link #getAlos72Zmanis() 72} minutes <em>zmaniyos</em>, or 1/10th of the day before
1385         * {@link #getSunrise() sunrise}. This time is 3 {@link #getShaahZmanis90MinutesZmanis() <em>shaos zmaniyos</em>}
1386         * (solar hours) after {@link #getAlos72Zmanis() dawn} based on the opinion of the MGA that the day is calculated
1387         * from a {@link #getAlos72Zmanis() dawn} of 72 minutes <em>zmaniyos</em>, or 1/10th of the day before
1388         * {@link #getSeaLevelSunrise() sea level sunrise} to {@link #getTzais72Zmanis() nightfall} of 72 minutes
1389         * <em>zmaniyos</em> after {@link #getSeaLevelSunset() sea level sunset}. This returns the time of 3 *
1390         * {@link #getShaahZmanis72MinutesZmanis()} after {@link #getAlos72Zmanis() dawn}.
1391         * 
1392         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1393         *         as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
1394         *         it does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1395         *         {@link AstronomicalCalendar} documentation.
1396         * @see #getShaahZmanis72MinutesZmanis()
1397         * @see #getAlos72Zmanis()
1398         * @see #isUseAstronomicalChatzosForOtherZmanim()
1399         */
1400        public Date getSofZmanShmaMGA72MinutesZmanis() {
1401                return getSofZmanShma(getAlos72Zmanis(), getTzais72Zmanis(), true);
1402        }
1403
1404        /**
1405         * This method returns the latest <em>zman krias shema</em> (time to recite <em>Shema</em> in the morning) according
1406         * to the opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on
1407         * <em>alos</em> being {@link #getAlos90() 90} minutes before {@link #getSunrise() sunrise}. This time is 3
1408         * {@link #getShaahZmanis90Minutes() <em>shaos zmaniyos</em>} (solar hours) after {@link #getAlos90() dawn} based on
1409         * the opinion of the MGA that the day is calculated from a {@link #getAlos90() dawn} of 90 minutes before sunrise to
1410         * {@link #getTzais90() nightfall} of 90 minutes after sunset. This returns the time of 3 *
1411         * {@link #getShaahZmanis90Minutes()} after {@link #getAlos90() dawn}.
1412         * 
1413         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1414         *         as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
1415         *         it does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1416         *         {@link AstronomicalCalendar} documentation.
1417         * @see #getShaahZmanis90Minutes()
1418         * @see #getAlos90()
1419         * @see #isUseAstronomicalChatzosForOtherZmanim()
1420         */
1421        public Date getSofZmanShmaMGA90Minutes() {
1422                return getSofZmanShma(getAlos90(), getTzais90(), true);
1423        }
1424
1425        /**
1426         * This method returns the latest <em>zman krias shema</em> (time to recite Shema in the morning) according to the
1427         * opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based
1428         * on <em>alos</em> being {@link #getAlos90Zmanis() 90} minutes <em>zmaniyos</em> before {@link #getSunrise()
1429         * sunrise}. This time is 3 {@link #getShaahZmanis90MinutesZmanis() <em>shaos zmaniyos</em>} (solar hours) after
1430         * {@link #getAlos90Zmanis() dawn} based on the opinion of the MGA that the day is calculated from a {@link
1431         * #getAlos90Zmanis() dawn} of 90 minutes <em>zmaniyos</em> before sunrise to {@link #getTzais90Zmanis() nightfall}
1432         * of 90 minutes <em>zmaniyos</em> after sunset. This returns the time of 3 * {@link #getShaahZmanis90MinutesZmanis()}
1433         * after {@link #getAlos90Zmanis() dawn}.
1434         * 
1435         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1436         *         as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
1437         *         it does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1438         *         {@link AstronomicalCalendar} documentation.
1439         * @see #getShaahZmanis90MinutesZmanis()
1440         * @see #getAlos90Zmanis()
1441         * @see #isUseAstronomicalChatzosForOtherZmanim()
1442         */
1443        public Date getSofZmanShmaMGA90MinutesZmanis() {
1444                return getSofZmanShma(getAlos90Zmanis(), getTzais90Zmanis(), true);
1445        }
1446
1447        /**
1448         * This method returns the latest <em>zman krias shema</em> (time to recite Shema in the morning) according to the
1449         * opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based
1450         * on <em>alos</em> being {@link #getAlos96() 96} minutes before {@link #getSunrise() sunrise}. This time is 3
1451         * {@link #getShaahZmanis96Minutes() <em>shaos zmaniyos</em>} (solar hours) after {@link #getAlos96() dawn} based on
1452         * the opinion of the MGA that the day is calculated from a {@link #getAlos96() dawn} of 96 minutes before
1453         * sunrise to {@link #getTzais96() nightfall} of 96 minutes after sunset. This returns the time of 3 * {@link
1454         * #getShaahZmanis96Minutes()} after {@link #getAlos96() dawn}.
1455         * 
1456         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1457         *         as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
1458         *         it does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1459         *         {@link AstronomicalCalendar} documentation.
1460         * @see #getShaahZmanis96Minutes()
1461         * @see #getAlos96()
1462         * @see #isUseAstronomicalChatzosForOtherZmanim()
1463         */
1464        public Date getSofZmanShmaMGA96Minutes() {
1465                return getSofZmanShma(getAlos96(), getTzais96(), true);
1466        }
1467
1468        /**
1469         * This method returns the latest <em>zman krias shema</em> (time to recite Shema in the morning) according to the
1470         * opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based
1471         * on <em>alos</em> being {@link #getAlos90Zmanis() 96} minutes <em>zmaniyos</em> before {@link #getSunrise()
1472         * sunrise}. This time is 3 {@link #getShaahZmanis96MinutesZmanis() <em>shaos zmaniyos</em>} (solar hours) after
1473         * {@link #getAlos96Zmanis() dawn} based on the opinion of the MGA that the day is calculated from a {@link
1474         * #getAlos96Zmanis() dawn} of 96 minutes <em>zmaniyos</em> before sunrise to {@link #getTzais90Zmanis() nightfall}
1475         * of 96 minutes <em>zmaniyos</em> after sunset. This returns the time of 3 * {@link #getShaahZmanis96MinutesZmanis()}
1476         * after {@link #getAlos96Zmanis() dawn}.
1477         * 
1478         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1479         *         as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
1480         *         it does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1481         *         {@link AstronomicalCalendar} documentation.
1482         * @see #getShaahZmanis96MinutesZmanis()
1483         * @see #getAlos96Zmanis()
1484         * @see #isUseAstronomicalChatzosForOtherZmanim()
1485         */
1486        public Date getSofZmanShmaMGA96MinutesZmanis() {
1487                return getSofZmanShma(getAlos96Zmanis(), getTzais96Zmanis(), true);
1488        }
1489
1490        /**
1491         * This method returns the latest <em>zman krias shema</em> (time to recite <em>Shema</em> in the morning) calculated
1492         * as 3 hours (regular clock hours and not <em>shaos zmaniyos</em>) before {@link ZmanimCalendar#getChatzos()}.
1493         * Generally known as part of the "Komarno" <em>zmanim</em> after <a href=
1494         * "https://en.wikipedia.org/wiki/Komarno_(Hasidic_dynasty)#Rabbi_Yitzchak_Eisik_Safrin">Rav Yitzchak Eizik of
1495         * Komarno</a>, a proponent of this calculation, it actually predates him a lot. It is the opinion of the 
1496         * <em>Shach</em> in the Nekudas Hakesef (Yoreh Deah 184), <a href=
1497         * "https://hebrewbooks.org/pdfpager.aspx?req=21638&st=&pgnum=30">Rav Moshe Lifshitz</a> in his commentary
1498         * <a href="https://hebrewbooks.org/pdfpager.aspx?req=21638&st=&pgnum=50">Lechem Mishneh on Brachos 1:2</a>. It is
1499         * next brought down about 100 years later by the <a href="https://en.wikipedia.org/wiki/Jacob_Emden">Yaavetz</a>
1500         * (in his <em>siddur</em>, <a href="https://hebrewbooks.org/pdfpager.aspx?req=7920&st=&pgnum=6">Mor Uktziah Orach
1501         * Chaim 1</a>, <a href="https://hebrewbooks.org/pdfpager.aspx?req=22309&st=&pgnum=30">Lechem Shamayim, Brachos 1:2</a>
1502         * and <a href="https://hebrewbooks.org/pdfpager.aspx?req=1408&st=&pgnum=69">She'elos Yaavetz vol. 1 no. 40</a>),
1503         * Rav Yitzchak Eizik of Komarno in the Ma'aseh Oreg on Mishnayos Brachos 11:2, Shevus Yaakov, Chasan Sofer and others.
1504         * See Yisrael Vehazmanim <a href="https://hebrewbooks.org/pdfpager.aspx?req=9765&st=&pgnum=83">vol. 1 7:3, page 55 -
1505         * 62</a>. A variant of this calculation {@link #getSofZmanShmaFixedLocal()} uses {@link #getFixedLocalChatzos() fixed
1506         * local <em>chatzos</em>} for calculating this type of <em>zman</em>.
1507         * 
1508         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1509         *         as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
1510         *         it does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1511         *         {@link AstronomicalCalendar} documentation.
1512         * @see ZmanimCalendar#getChatzos()
1513         * @see #getSofZmanShmaFixedLocal()
1514         * @see #getSofZmanTfila2HoursBeforeChatzos()
1515         * @see #isUseAstronomicalChatzos()
1516         */
1517        public Date getSofZmanShma3HoursBeforeChatzos() {
1518                return getTimeOffset(getChatzos(), -180 * MINUTE_MILLIS);
1519        }
1520
1521        /**
1522         * This method returns the latest <em>zman krias shema</em> (time to recite Shema in the morning) according to the
1523         * opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based
1524         * on <em>alos</em> being {@link #getAlos120() 120} minutes or 1/6th of the day before {@link #getSunrise() sunrise}.
1525         * This time is 3 {@link #getShaahZmanis120Minutes() <em>shaos zmaniyos</em>} (solar hours) after {@link #getAlos120()
1526         * dawn} based on the opinion of the MGA that the day is calculated from a {@link #getAlos120() dawn} of 120 minutes
1527         * before sunrise to {@link #getTzais120() nightfall} of 120 minutes after sunset. This returns the time of 3
1528         * {@link #getShaahZmanis120Minutes()} after {@link #getAlos120() dawn}. This is an extremely early <em>zman</em> that
1529         * is very much a <em>chumra</em>.
1530         * 
1531         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1532         *         as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
1533         *         it does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1534         *         {@link AstronomicalCalendar} documentation.
1535         * @see #getShaahZmanis120Minutes()
1536         * @see #getAlos120()
1537         * @see #isUseAstronomicalChatzosForOtherZmanim()
1538         */
1539        public Date getSofZmanShmaMGA120Minutes() {
1540                return getSofZmanShma(getAlos120(), getTzais120(), true);
1541        }
1542
1543        /**
1544         * This method returns the latest <em>zman krias shema</em> (time to recite <em>Shema</em> in the morning) based
1545         * on the opinion that the day starts at {@link #getAlos16Point1Degrees() <em>alos</em> 16.1&deg;} and ends at
1546         * {@link #getSeaLevelSunset() sea level sunset}. This is the opinion of the <a href=
1547         * "https://hebrewbooks.org/40357">\u05D7\u05D9\u05D3\u05D5\u05E9\u05D9
1548         * \u05D5\u05DB\u05DC\u05DC\u05D5\u05EA \u05D4\u05E8\u05D6\u05F4\u05D4</a> and the <a href=
1549         * "https://hebrewbooks.org/14799">\u05DE\u05E0\u05D5\u05E8\u05D4 \u05D4\u05D8\u05D4\u05D5\u05E8\u05D4</a> as
1550         * mentioned by Yisrael Vehazmanim <a href="https://hebrewbooks.org/pdfpager.aspx?req=9765&pgnum=81">vol 1, sec. 7,
1551         * ch. 3 no. 16</a>. Three <em>shaos zmaniyos</em> are calculated based on this day and added to {@link
1552         * #getAlos16Point1Degrees() <em>alos</em>} to reach this time. This time is 3 <em>shaos zmaniyos</em> (solar hours)
1553         * after {@link #getAlos16Point1Degrees() dawn} based on the opinion that the day is calculated from a {@link
1554         * #getAlos16Point1Degrees() <em>alos</em> 16.1&deg;} to {@link #getSeaLevelSunset() sea level sunset}.
1555         * <b>Note: </b> Based on this calculation <em>chatzos</em> will not be at midday and {@link
1556         * #isUseAstronomicalChatzosForOtherZmanim()} will be ignored.
1557         * 
1558         * @return the <code>Date</code> of the latest <em>zman krias shema</em> based on this day. If the calculation can't
1559         *         be computed such as northern and southern locations even south of the Arctic Circle and north of the
1560         *         Antarctic Circle where the sun may not reach low enough below the horizon for this calculation, a null
1561         *         will be returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
1562         * @see #getAlos16Point1Degrees()
1563         * @see #getSeaLevelSunset()
1564         */
1565        public Date getSofZmanShmaAlos16Point1ToSunset() {
1566                return getSofZmanShma(getAlos16Point1Degrees(), getElevationAdjustedSunset(), false);
1567        }
1568
1569        /**
1570         * This method returns the latest <em>zman krias shema</em> (time to recite Shema in the morning) based on the
1571         * opinion that the day starts at {@link #getAlos16Point1Degrees() <em>alos</em> 16.1&deg;} and ends at
1572         * {@link #getTzaisGeonim7Point083Degrees() <em>tzais</em> 7.083&deg;}. 3 <em>shaos zmaniyos</em> are calculated
1573         * based on this day and added to {@link #getAlos16Point1Degrees() <em>alos</em>} to reach this time. This time is 3
1574         * <em>shaos zmaniyos</em> (temporal hours) after {@link #getAlos16Point1Degrees() <em>alos</em> 16.1&deg;} based on
1575         * the opinion that the day is calculated from a {@link #getAlos16Point1Degrees() <em>alos</em> 16.1&deg;} to
1576         * {@link #getTzaisGeonim7Point083Degrees() <em>tzais</em> 7.083&deg;}.
1577         * <b>Note: </b> Based on this calculation <em>chatzos</em> will not be at midday and {@link
1578         * #isUseAstronomicalChatzosForOtherZmanim()} will be ignored.
1579         * 
1580         * @return the <code>Date</code> of the latest <em>zman krias shema</em> based on this calculation. If the
1581         *         calculation can't be computed such as northern and southern locations even south of the Arctic Circle and
1582         *         north of the Antarctic Circle where the sun may not reach low enough below the horizon for this
1583         *         calculation, a <code>null</code> will be returned. See detailed explanation on top of the
1584         *         {@link AstronomicalCalendar} documentation.
1585         * @see #getAlos16Point1Degrees()
1586         * @see #getTzaisGeonim7Point083Degrees()
1587         */
1588        public Date getSofZmanShmaAlos16Point1ToTzaisGeonim7Point083Degrees() {
1589                return getSofZmanShma(getAlos16Point1Degrees(), getTzaisGeonim7Point083Degrees(), false);
1590        }
1591
1592        /**
1593         * From the GRA in Kol Eliyahu on Berachos #173 that states that <em>zman krias shema</em> is calculated as half the
1594         * time from {@link #getSeaLevelSunrise() sea level sunrise} to {@link #getFixedLocalChatzos() fixed local chatzos}.
1595         * The GRA himself seems to contradict this when he stated that <em>zman krias shema</em> is 1/4 of the day from
1596         * sunrise to sunset. See <em>Sarah Lamoed</em> #25 in Yisroel Vehazmanim Vol. III page 1016.
1597         * 
1598         * @return the <code>Date</code> of the latest <em>zman krias shema</em> based on this calculation. If the
1599         *         calculation can't be computed such as in the Arctic Circle where there is at least one day a year where
1600         *         the sun does not rise, and one where it does not set, a <code>null</code> will be returned. See detailed
1601         *         explanation on top of the {@link AstronomicalCalendar} documentation.
1602         * @see #getFixedLocalChatzos()
1603         * 
1604         * @deprecated As per a conversation Rabbi Yisroel Twerski had with Rabbi Harfenes, this <em>zman</em> published in
1605         *         the Yisrael Vehazmanim was based on a misunderstanding and should not be used. This deprecated method
1606         *         will be removed (likely in v3.0) pending confirmation from Rabbi Harfenes.
1607         */
1608        @Deprecated // (since="1.3", forRemoval=true) // add back once Java 9 is the minimum supported version
1609        public Date getSofZmanShmaKolEliyahu() {
1610                Date chatzos = getFixedLocalChatzos();
1611                if (chatzos == null || getSunrise() == null) {
1612                        return null;
1613                }
1614                long diff = (chatzos.getTime() - getElevationAdjustedSunrise().getTime()) / 2;
1615                return getTimeOffset(chatzos, -diff);
1616        }
1617
1618        /**
1619         * This method returns the latest <em>zman tfila</em> (time to recite the morning prayers) according to the opinion
1620         * of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on
1621         * <em>alos</em> being {@link #getAlos19Point8Degrees() 19.8&deg;} before {@link #getSunrise() sunrise}. This time
1622         * is 4 {@link #getShaahZmanis19Point8Degrees() <em>shaos zmaniyos</em>} (solar hours) after {@link
1623         * #getAlos19Point8Degrees() dawn} based on the opinion of the MGA that the day is calculated from dawn to
1624         * nightfall with both being 19.8&deg; below sunrise or sunset. This returns the time of 4 * {@link
1625         * #getShaahZmanis19Point8Degrees()} after {@link #getAlos19Point8Degrees() dawn}.
1626         * 
1627         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1628         *         as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
1629         *         where the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be
1630         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
1631         * 
1632         * @see #getShaahZmanis19Point8Degrees()
1633         * @see #getAlos19Point8Degrees()
1634         * @see #isUseAstronomicalChatzosForOtherZmanim()
1635         */
1636        public Date getSofZmanTfilaMGA19Point8Degrees() {
1637                return getSofZmanTfila(getAlos19Point8Degrees(), getTzais19Point8Degrees(), true);
1638        }
1639
1640        /**
1641         * This method returns the latest <em>zman tfila</em> (time to recite the morning prayers) according to the opinion
1642         * of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on
1643         * <em>alos</em> being {@link #getAlos16Point1Degrees() 16.1&deg;} before {@link #getSunrise() sunrise}. This time
1644         * is 4 {@link #getShaahZmanis16Point1Degrees() <em>shaos zmaniyos</em>} (solar hours) after {@link
1645         * #getAlos16Point1Degrees() dawn} based on the opinion of the MGA that the day is calculated from dawn to
1646         * nightfall with both being 16.1&deg; below sunrise or sunset. This returns the time of 4 * {@link
1647         * #getShaahZmanis16Point1Degrees()} after {@link #getAlos16Point1Degrees() dawn}.
1648         * 
1649         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1650         *         as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
1651         *         where the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be
1652         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
1653         * 
1654         * @see #getShaahZmanis16Point1Degrees()
1655         * @see #getAlos16Point1Degrees()
1656         */
1657        public Date getSofZmanTfilaMGA16Point1Degrees() {
1658                return getSofZmanTfila(getAlos16Point1Degrees(), getTzais16Point1Degrees(), true);
1659        }
1660
1661        /**
1662         * This method returns the latest <em>zman tfila</em> (time to recite the morning prayers) according to the opinion
1663         * of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on
1664         * <em>alos</em> being {@link #getAlos18Degrees() 18&deg;} before {@link #getSunrise() sunrise}. This time is 4
1665         * {@link #getShaahZmanis18Degrees() <em>shaos zmaniyos</em>} (solar hours) after {@link #getAlos18Degrees() dawn}
1666         * based on the opinion of the MGA that the day is calculated from dawn to nightfall with both being 18&deg;
1667         * below sunrise or sunset. This returns the time of 4 * {@link #getShaahZmanis18Degrees()} after
1668         * {@link #getAlos18Degrees() dawn}.
1669         * 
1670         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1671         *         as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
1672         *         where the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be
1673         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
1674         * 
1675         * @see #getShaahZmanis18Degrees()
1676         * @see #getAlos18Degrees()
1677         */
1678        public Date getSofZmanTfilaMGA18Degrees() {
1679                return getSofZmanTfila(getAlos18Degrees(), getTzais18Degrees(), true);
1680        }
1681
1682        /**
1683         * This method returns the latest <em>zman tfila</em> (time to recite the morning prayers) according to the opinion
1684         * of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on
1685         * <em>alos</em> being {@link #getAlos72() 72} minutes before {@link #getSunrise() sunrise}. This time is 4
1686         * {@link #getShaahZmanis72Minutes() <em>shaos zmaniyos</em>} (solar hours) after {@link #getAlos72() dawn} based on
1687         * the opinion of the MGA that the day is calculated from a {@link #getAlos72() dawn} of 72 minutes before
1688         * sunrise to {@link #getTzais72() nightfall} of 72 minutes after sunset. This returns the time of 4 *
1689         * {@link #getShaahZmanis72Minutes()} after {@link #getAlos72() dawn}. This class returns an identical time to
1690         * {@link #getSofZmanTfilaMGA()} and is repeated here for clarity.
1691         * 
1692         * @return the <code>Date</code> of the latest <em>zman tfila</em>. If the calculation can't be computed such as in
1693         *         the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
1694         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1695         *         {@link AstronomicalCalendar} documentation.
1696         * @see #getShaahZmanis72Minutes()
1697         * @see #getAlos72()
1698         * @see #getSofZmanShmaMGA()
1699         */
1700        public Date getSofZmanTfilaMGA72Minutes() {
1701                return getSofZmanTfilaMGA();
1702        }
1703
1704        /**
1705         * This method returns the latest <em>zman tfila</em> (time to the morning prayers) according to the opinion of the
1706         * <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on <em>alos</em>
1707         * being {@link #getAlos72Zmanis() 72} minutes <em>zmaniyos</em> before {@link #getSunrise() sunrise}. This time is 4
1708         * {@link #getShaahZmanis72MinutesZmanis() <em>shaos zmaniyos</em>} (solar hours) after {@link #getAlos72Zmanis() dawn}
1709         * based on the opinion of the MGA that the day is calculated from a {@link #getAlos72Zmanis() dawn} of 72
1710         * minutes <em>zmaniyos</em> before sunrise to {@link #getTzais72Zmanis() nightfall} of 72 minutes <em>zmaniyos</em>
1711         * after sunset. This returns the time of 4 * {@link #getShaahZmanis72MinutesZmanis()} after {@link #getAlos72Zmanis() dawn}.
1712         * 
1713         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1714         *         as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
1715         *         it does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1716         *         {@link AstronomicalCalendar} documentation.
1717         * @see #getShaahZmanis72MinutesZmanis()
1718         * @see #getAlos72Zmanis()
1719         */
1720        public Date getSofZmanTfilaMGA72MinutesZmanis() {
1721                return getSofZmanTfila(getAlos72Zmanis(), getTzais72Zmanis(), true);
1722        }
1723
1724        /**
1725         * This method returns the latest <em>zman tfila</em> (time to recite the morning prayers) according to the opinion
1726         * of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on
1727         * <em>alos</em> being {@link #getAlos90() 90} minutes before {@link #getSunrise() sunrise}. This time is 4
1728         * {@link #getShaahZmanis90Minutes() <em>shaos zmaniyos</em>} (solar hours) after {@link #getAlos90() dawn} based on
1729         * the opinion of the MGA that the day is calculated from a {@link #getAlos90() dawn} of 90 minutes before sunrise to
1730         * {@link #getTzais90() nightfall} of 90 minutes after sunset. This returns the time of 4 *
1731         * {@link #getShaahZmanis90Minutes()} after {@link #getAlos90() dawn}.
1732         * 
1733         * @return the <code>Date</code> of the latest <em>zman tfila</em>. If the calculation can't be computed such as in
1734         *         the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
1735         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1736         *         {@link AstronomicalCalendar} documentation.
1737         * @see #getShaahZmanis90Minutes()
1738         * @see #getAlos90()
1739         */
1740        public Date getSofZmanTfilaMGA90Minutes() {
1741                return getSofZmanTfila(getAlos90(), getTzais90(), true);
1742        }
1743
1744        /**
1745         * This method returns the latest <em>zman tfila</em> (time to the morning prayers) according to the opinion of the
1746         * <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on <em>alos</em>
1747         * being {@link #getAlos90Zmanis() 90} minutes <em>zmaniyos</em> before {@link #getSunrise() sunrise}. This time is
1748         * 4 {@link #getShaahZmanis90MinutesZmanis() <em>shaos zmaniyos</em>} (solar hours) after {@link #getAlos90Zmanis()
1749         * dawn} based on the opinion of the MGA that the day is calculated from a {@link #getAlos90Zmanis() dawn}
1750         * of 90 minutes <em>zmaniyos</em> before sunrise to {@link #getTzais90Zmanis() nightfall} of 90 minutes
1751         * <em>zmaniyos</em> after sunset. This returns the time of 4 * {@link #getShaahZmanis90MinutesZmanis()} after
1752         * {@link #getAlos90Zmanis() dawn}.
1753         * 
1754         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1755         *         as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
1756         *         it does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1757         *         {@link AstronomicalCalendar} documentation.
1758         * @see #getShaahZmanis90MinutesZmanis()
1759         * @see #getAlos90Zmanis()
1760         */
1761        public Date getSofZmanTfilaMGA90MinutesZmanis() {
1762                return getSofZmanTfila(getAlos90Zmanis(), getTzais90Zmanis(), true);
1763        }
1764
1765        /**
1766         * This method returns the latest <em>zman tfila</em> (time to recite the morning prayers) according to the opinion
1767         * of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on
1768         * <em>alos</em> being {@link #getAlos96() 96} minutes before {@link #getSunrise() sunrise}. This time is 4
1769         * {@link #getShaahZmanis96Minutes() <em>shaos zmaniyos</em>} (solar hours) after {@link #getAlos96() dawn} based on
1770         * the opinion of the MGA that the day is calculated from a {@link #getAlos96() dawn} of 96 minutes before
1771         * sunrise to {@link #getTzais96() nightfall} of 96 minutes after sunset. This returns the time of 4 *
1772         * {@link #getShaahZmanis96Minutes()} after {@link #getAlos96() dawn}.
1773         * 
1774         * @return the <code>Date</code> of the latest <em>zman tfila</em>. If the calculation can't be computed such as in
1775         *         the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
1776         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1777         *         {@link AstronomicalCalendar} documentation.
1778         * @see #getShaahZmanis96Minutes()
1779         * @see #getAlos96()
1780         */
1781        public Date getSofZmanTfilaMGA96Minutes() {
1782                return getSofZmanTfila(getAlos96(), getTzais96(), true);
1783        }
1784
1785        /**
1786         * This method returns the latest <em>zman tfila</em> (time to the morning prayers) according to the opinion of the
1787         * <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on <em>alos</em>
1788         * being {@link #getAlos96Zmanis() 96} minutes <em>zmaniyos</em> before {@link #getSunrise() sunrise}. This time is
1789         * 4 {@link #getShaahZmanis96MinutesZmanis() <em>shaos zmaniyos</em>} (solar hours) after {@link #getAlos96Zmanis()
1790         * dawn} based on the opinion of the MGA that the day is calculated from a {@link #getAlos96Zmanis() dawn}
1791         * of 96 minutes <em>zmaniyos</em> before sunrise to {@link #getTzais96Zmanis() nightfall} of 96 minutes
1792         * <em>zmaniyos</em> after sunset. This returns the time of 4 * {@link #getShaahZmanis96MinutesZmanis()} after
1793         * {@link #getAlos96Zmanis() dawn}.
1794         * 
1795         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1796         *         as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
1797         *         it does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1798         *         {@link AstronomicalCalendar} documentation.
1799         * @see #getShaahZmanis90MinutesZmanis()
1800         * @see #getAlos90Zmanis()
1801         */
1802        public Date getSofZmanTfilaMGA96MinutesZmanis() {
1803                return getSofZmanTfila(getAlos96Zmanis(), getTzais96Zmanis(), true);
1804        }
1805
1806        /**
1807         * This method returns the latest <em>zman tfila</em> (time to recite the morning prayers) according to the opinion
1808         * of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on
1809         * <em>alos</em> being {@link #getAlos120() 120} minutes before {@link #getSunrise() sunrise} . This time is 4
1810         * {@link #getShaahZmanis120Minutes() <em>shaos zmaniyos</em>} (solar hours) after {@link #getAlos120() dawn}
1811         * based on the opinion of the MGA that the day is calculated from a {@link #getAlos120() dawn} of 120
1812         * minutes before sunrise to {@link #getTzais120() nightfall} of 120 minutes after sunset. This returns the time of
1813         * 4 * {@link #getShaahZmanis120Minutes()} after {@link #getAlos120() dawn}. This is an extremely early <em>zman</em>
1814         * that is very much a <em>chumra</em>.
1815         * 
1816         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1817         *         as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
1818         *         it does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1819         *         {@link AstronomicalCalendar} documentation.
1820         * @see #getShaahZmanis120Minutes()
1821         * @see #getAlos120()
1822         */
1823        public Date getSofZmanTfilaMGA120Minutes() {
1824                return getSofZmanTfila(getAlos120(), getTzais120(), true);
1825        }
1826
1827        /**
1828         * This method returns the latest <em>zman tfila</em> (time to recite the morning prayers) calculated as 2 hours
1829         * before {@link ZmanimCalendar#getChatzos()}. This is based on the opinions that calculate
1830         * <em>sof zman krias shema</em> as {@link #getSofZmanShma3HoursBeforeChatzos()}. This returns the time of 2 hours
1831         * before {@link ZmanimCalendar#getChatzos()}.
1832         * 
1833         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
1834         *         as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where
1835         *         it does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1836         *         {@link AstronomicalCalendar} documentation.
1837         * @see ZmanimCalendar#getChatzos()
1838         * @see #getSofZmanShma3HoursBeforeChatzos()
1839         */
1840        public Date getSofZmanTfila2HoursBeforeChatzos() {
1841                return getTimeOffset(getChatzos(), -120 * MINUTE_MILLIS);
1842        }
1843
1844        /**
1845         * This method returns <em>mincha gedola</em> calculated as 30 minutes after {@link #getChatzos() <em>chatzos</em>}
1846         * and not 1/2 of a {@link #getShaahZmanisGra() <em>shaah zmanis</em>} after {@link #getChatzos() <em>chatzos</em>} as
1847         * calculated by {@link #getMinchaGedola}. Some use this time to delay the start of <em>mincha</em> in the winter when
1848         * 1/2 of a {@link #getShaahZmanisGra() <em>shaah zmanis</em>} is less than 30 minutes. See
1849         * {@link #getMinchaGedolaGreaterThan30()} for a convenience method that returns the later of the 2 calculations. One
1850         * should not use this time to start <em>mincha</em> before the standard {@link #getMinchaGedola() <em>mincha gedola</em>}.
1851         * See Shulchan Aruch <a href="https://hebrewbooks.org/pdfpager.aspx?req=49624&st=&pgnum=291">Orach Chayim 234:1</a> and
1852         * the Shaar Hatziyon <em>seif katan ches</em>. Since this calculation is a fixed 30 minutes of regular clock time after
1853         * <em>chatzos</em>, even if {@link #isUseAstronomicalChatzosForOtherZmanim()} is <code>false</code>, this <em>mincha
1854         * gedola</em> time will be affected by {@link #isUseAstronomicalChatzos()} and not by
1855         * {@link #isUseAstronomicalChatzosForOtherZmanim()}.
1856         * 
1857         * @return the <code>Date</code> of 30 minutes after <em>chatzos</em>. If the calculation can't be computed such as
1858         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
1859         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1860         *         {@link AstronomicalCalendar} documentation.
1861         * @see #getMinchaGedola()
1862         * @see #getMinchaGedolaGreaterThan30()
1863         * @see #getChatzos()
1864         * @see #isUseAstronomicalChatzos()
1865         * @see #isUseAstronomicalChatzosForOtherZmanim()
1866         */
1867        public Date getMinchaGedola30Minutes() {
1868                return getTimeOffset(getChatzos(), MINUTE_MILLIS * 30);
1869        }
1870
1871        /**
1872         * This method returns the time of <em>mincha gedola</em> according to the Magen Avraham with the day starting 72
1873         * minutes before sunrise and ending 72 minutes after sunset. This is the earliest time to pray <em>mincha</em>. For
1874         * more information on this see the documentation on {@link #getMinchaGedola() <em>mincha gedola</em>}. This is
1875         * calculated as 6.5 {@link #getTemporalHour() solar hours} after <em>alos</em>. The calculation used is 6.5 *
1876         * {@link #getShaahZmanis72Minutes()} after {@link #getAlos72() <em>alos</em>}. If {@link
1877         * #isUseAstronomicalChatzosForOtherZmanim()} is set to <code>true</code>, the calculation will be based on 0.5
1878         * {@link #getHalfDayBasedShaahZmanis(Date, Date) half-day based <em>sha'ah zmanis</em>} between {@link #getChatzos()}
1879         * and {@link #getTzais72()} after {@link #getChatzos()}.
1880         * 
1881         * @see #getAlos72()
1882         * @see #getMinchaGedola()
1883         * @see #getMinchaKetana()
1884         * @see ZmanimCalendar#getMinchaGedola()
1885         * @see #getChatzos()
1886         * @see #isUseAstronomicalChatzosForOtherZmanim()
1887         * @return the <code>Date</code> of the time of <em>mincha gedola</em>. If the calculation can't be computed such as
1888         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
1889         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
1890         *         {@link AstronomicalCalendar} documentation.
1891         */
1892        public Date getMinchaGedola72Minutes() {
1893                if (isUseAstronomicalChatzosForOtherZmanim()) {
1894                        return getHalfDayBasedZman(getChatzos(), getTzais72(), 0.5);
1895                } else {
1896                        return getMinchaGedola(getAlos72(), getTzais72(), true);
1897                }
1898        }
1899
1900        /**
1901         * This method returns the time of <em>mincha gedola</em> according to the Magen Avraham with the day starting and
1902         * ending 16.1&deg; below the horizon. This is the earliest time to pray <em>mincha</em>. For more information on
1903         * this see the documentation on {@link #getMinchaGedola() <em>mincha gedola</em>}. This is calculated as 6.5
1904         * {@link #getTemporalHour() solar hours} after <em>alos</em>. The calculation used is 6.5 *
1905         * {@link #getShaahZmanis16Point1Degrees()} after {@link #getAlos16Point1Degrees() <em>alos</em>}. If {@link
1906         * #isUseAstronomicalChatzosForOtherZmanim()} is set to <code>true</code>, the calculation will be based on 0.5
1907         * {@link #getHalfDayBasedShaahZmanis(Date, Date) half-day based <em>sha'ah zmanis</em>} between {@link #getChatzos()}
1908         * and {@link #getAlos16Point1Degrees()} after {@link #getChatzos()}.
1909         * @see #getShaahZmanis16Point1Degrees()
1910         * @see #getMinchaGedola()
1911         * @see #getMinchaKetana()
1912         * @return the <code>Date</code> of the time of <em>mincha gedola</em>. If the calculation can't be computed such as
1913         *         northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle where
1914         *         the sun  may not reach low enough below the horizon for this calculation, a <code>null</code> will be returned.
1915         *         See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
1916         */
1917        public Date getMinchaGedola16Point1Degrees() {
1918                if (isUseAstronomicalChatzosForOtherZmanim()) {
1919                        return getHalfDayBasedZman(getChatzos(), getTzais16Point1Degrees(), 0.5);
1920                } else {
1921                        return getMinchaGedola(getAlos16Point1Degrees(), getTzais16Point1Degrees(), true);
1922                }
1923                
1924        }
1925        
1926        /**
1927         * This method returns the time of <em>mincha gedola</em> based on the opinion of <a href=
1928         * "https://en.wikipedia.org/wiki/Yaakov_Moshe_Hillel">Rabbi Yaakov Moshe Hillel</a> as published in the <em>luach</em>
1929         * of the Bais Horaah of Yeshivat Chevrat Ahavat Shalom that <em>mincha gedola</em> is calculated as half a <em>shaah
1930         * zmanis</em> after <em>chatzos</em> with <em>shaos zmaniyos</em> calculated based on a day starting 72 minutes before sunrise
1931         * {@link #getAlos16Point1Degrees() <em>alos</em> 16.1&deg;} and ending 13.5 minutes after sunset {@link
1932         * #getTzaisGeonim3Point7Degrees() <em>tzais</em> 3.7&deg;}. <em>Mincha gedola</em> is the earliest time to pray <em>mincha</em>.
1933         * The later of this time or 30 clock minutes after <em>chatzos</em> is returned. See {@link #getMinchaGedolaGreaterThan30()}
1934         * (though that calculation is based on <em>mincha gedola</em> GRA).
1935         * For more information about <em>mincha gedola</em> see the documentation on {@link #getMinchaGedola() <em>mincha gedola</em>}.
1936         * Since calculation of this <em>zman</em> involves <em>chatzos</em> that is offset from the center of the astronomical day,
1937         * {@link #isUseAstronomicalChatzosForOtherZmanim()} is N/A here.
1938         * @return the <code>Date</code> of the <em>mincha gedola</em>. If the calculation can't be computed such as northern and
1939         *         southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may not
1940         *         reach low enough below the horizon for this calculation, a <code>null</code> will be returned. See detailed
1941         *         explanation on top of the {@link AstronomicalCalendar} documentation.
1942         * 
1943         * @see #getAlos16Point1Degrees()
1944         * @see #getTzaisGeonim3Point7Degrees()
1945         * @see #getShaahZmanisAlos16Point1ToTzais3Point7()
1946         * @see #getMinchaGedolaGreaterThan30()
1947         */
1948        public Date getMinchaGedolaAhavatShalom() {
1949                if (getChatzos() == null || getMinchaGedola30Minutes() == null || getShaahZmanisAlos16Point1ToTzais3Point7() == Long.MIN_VALUE) {
1950                        return null;
1951                } else {
1952                        return getMinchaGedola30Minutes().compareTo(getTimeOffset(getChatzos(), getShaahZmanisAlos16Point1ToTzais3Point7() / 2)) > 0 ?
1953                                        getMinchaGedola30Minutes() : getTimeOffset(getChatzos(), getShaahZmanisAlos16Point1ToTzais3Point7() / 2);
1954                }
1955        }
1956
1957        /**
1958         * FIXME check for synchronous
1959         * This is a convenience method that returns the later of {@link #getMinchaGedola()} and
1960         * {@link #getMinchaGedola30Minutes()}. In the winter when 1/2 of a {@link #getShaahZmanisGra() <em>shaah zmanis</em>} is
1961         * less than 30 minutes {@link #getMinchaGedola30Minutes()} will be returned, otherwise {@link #getMinchaGedola()}
1962         * will be returned. Since this calculation can be an offset of <em>chatzos</em> (if 30 clock minutes > 1/2 of a <em>shaah
1963         * zmanis</em>), even if {@link #isUseAstronomicalChatzosForOtherZmanim()} is <code>false</code>, this <em>mincha</em> time
1964         * may be affected by {@link #isUseAstronomicalChatzos()}.
1965         * 
1966         * @return the <code>Date</code> of the later of {@link #getMinchaGedola()} and {@link #getMinchaGedola30Minutes()}.
1967         *         If the calculation can't be computed such as in the Arctic Circle where there is at least one day a year
1968         *         where the sun does not rise, and one where it does not set, a <code>null</code> will be returned. See detailed
1969         *         explanation on top of the {@link AstronomicalCalendar} documentation.
1970         * @see #getMinchaGedola()
1971         * @see #getMinchaGedola30Minutes()
1972         * @see #isUseAstronomicalChatzos()
1973         * 
1974         */
1975        public Date getMinchaGedolaGreaterThan30() {
1976                if (getMinchaGedola30Minutes() == null || getMinchaGedola() == null) {
1977                        return null;
1978                } else {
1979                        return getMinchaGedola30Minutes().compareTo(getMinchaGedola()) > 0 ? getMinchaGedola30Minutes()
1980                                        : getMinchaGedola();
1981                }
1982        }
1983
1984        /**
1985         * This method returns the time of <em>mincha ketana</em> according to the Magen Avraham with the day starting and
1986         * ending 16.1&deg; below the horizon. This is the preferred earliest time to pray <em>mincha</em> according to the
1987         * opinion of the <a href="https://en.wikipedia.org/wiki/Maimonides">Rambam</a> and others. For more information on
1988         * this see the documentation on {@link #getMinchaGedola() <em>mincha gedola</em>}. This is calculated as 9.5
1989         * {@link #getTemporalHour() solar hours} after <em>alos</em>. The calculation used is 9.5 *
1990         * {@link #getShaahZmanis16Point1Degrees()} after {@link #getAlos16Point1Degrees() <em>alos</em>}.
1991         * 
1992         * @see #getShaahZmanis16Point1Degrees()
1993         * @see #getMinchaGedola()
1994         * @see #getMinchaKetana()
1995         * @return the <code>Date</code> of the time of <em>mincha ketana</em>. If the calculation can't be computed such
1996         *         as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
1997         *         where the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be
1998         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
1999         */
2000        public Date getMinchaKetana16Point1Degrees() {
2001                return getMinchaKetana(getAlos16Point1Degrees(), getTzais16Point1Degrees(), true);
2002        }
2003        
2004        /**
2005         * This method returns the time of <em>mincha ketana</em> based on the opinion of <a href=
2006         * "https://en.wikipedia.org/wiki/Yaakov_Moshe_Hillel">Rabbi Yaakov Moshe Hillel</a> as published in the <em>luach</em>
2007         * of the Bais Horaah of Yeshivat Chevrat Ahavat Shalom that <em>mincha ketana</em> is calculated as 2.5 <em>shaos
2008         * zmaniyos</em> before {@link #getTzaisGeonim3Point8Degrees() <em>tzais</em> 3.8&deg;} with <em>shaos zmaniyos</em>
2009         * calculated based on a day starting at {@link #getAlos16Point1Degrees() <em>alos</em> 16.1&deg;} and ending at
2010         * <em>tzais</em> 3.8&deg;. <em>Mincha ketana</em> is the preferred earliest time to pray <em>mincha</em> according to
2011         * the opinion of the <a href="https://en.wikipedia.org/wiki/Maimonides">Rambam</a> and others. For more information
2012         * on this see the documentation on {@link #getMinchaKetana() <em>mincha ketana</em>}.
2013         * 
2014         * @return the <code>Date</code> of the time of <em>mincha ketana</em>. If the calculation can't be computed such as
2015         *         northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle where the
2016         *         sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be returned.
2017         *         See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
2018         * 
2019         * @see #getShaahZmanisAlos16Point1ToTzais3Point8()
2020         * @see #getMinchaGedolaAhavatShalom()
2021         * @see #getPlagAhavatShalom()
2022         */
2023        public Date getMinchaKetanaAhavatShalom() {
2024                return getTimeOffset(getTzaisGeonim3Point8Degrees(), -getShaahZmanisAlos16Point1ToTzais3Point8() * 2.5);
2025        }
2026
2027        /**
2028         * This method returns the time of <em>mincha ketana</em> according to the Magen Avraham with the day
2029         * starting 72 minutes before sunrise and ending 72 minutes after sunset. This is the preferred earliest time to pray
2030         * <em>mincha</em> according to the opinion of the <a href="https://en.wikipedia.org/wiki/Maimonides">Rambam</a>
2031         * and others. For more information on this see the documentation on {@link #getMinchaGedola() <em>mincha gedola</em>}.
2032         * This is calculated as 9.5 {@link #getShaahZmanis72Minutes()} after <em>alos</em>. The calculation used is 9.5 *
2033         * {@link #getShaahZmanis72Minutes()} after {@link #getAlos72() <em>alos</em>}.
2034         * 
2035         * @see #getShaahZmanis16Point1Degrees()
2036         * @see #getMinchaGedola()
2037         * @see #getMinchaKetana()
2038         * @return the <code>Date</code> of the time of <em>mincha ketana</em>. If the calculation can't be computed such as
2039         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
2040         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
2041         *         {@link AstronomicalCalendar} documentation.
2042         */
2043        public Date getMinchaKetana72Minutes() {
2044                return getMinchaKetana(getAlos72(), getTzais72(), true);
2045        }
2046
2047        /**
2048         * This method returns the time of <em>plag hamincha</em> according to the Magen Avraham with the day starting 60
2049         * minutes before sunrise and ending 60 minutes after sunset. This is calculated as 10.75 hours after
2050         * {@link #getAlos60() dawn}. The formula used is 10.75 {@link #getShaahZmanis60Minutes()} after {@link #getAlos60()}.
2051         * 
2052         * @return the <code>Date</code> of the time of <em>plag hamincha</em>. If the calculation can't be computed such as
2053         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
2054         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
2055         *         {@link AstronomicalCalendar} documentation.
2056         * 
2057         * @see #getShaahZmanis60Minutes()
2058         * @see #getAlos60()
2059         * @see #getTzais60()
2060         */
2061        public Date getPlagHamincha60Minutes() {
2062                return getPlagHamincha(getAlos60(), getTzais60(), true);
2063        }
2064
2065        /**
2066         * This method should be used <em>lechumra</em> only and returns the time of <em>plag hamincha</em> according to the
2067         * Magen Avraham with the day starting 72 minutes before sunrise and ending 72 minutes after sunset. This is calculated
2068         * as 10.75 hours after {@link #getAlos72() dawn}. The formula used is 10.75 {@link #getShaahZmanis72Minutes()} after
2069         * {@link #getAlos72()}. Since <em>plag</em> by this calculation can occur after sunset, it should only be used
2070         * <em>lechumra</em>.
2071         * 
2072         * @deprecated This method should be used <em>lechumra</em> only since it returns a very late time (often after
2073         *         <em>shkiah</em>), and if used <em>lekula</em> can result in <em>chillul Shabbos</em> etc. There is no
2074         *         current plan to remove this method from the API, and this deprecation is intended to alert developers
2075         *         of the danger of using it.
2076         * 
2077         * @return the <code>Date</code> of the time of <em>plag hamincha</em>. If the calculation can't be computed such as
2078         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
2079         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
2080         *         {@link AstronomicalCalendar} documentation.
2081         * 
2082         * @see #getShaahZmanis72Minutes()
2083         */
2084        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
2085        public Date getPlagHamincha72Minutes() {
2086                return getPlagHamincha(getAlos72(), getTzais72(), true);
2087        }
2088
2089        /**
2090         * This method should be used <em>lechumra</em> only and returns the time of <em>plag hamincha</em> according to the
2091         * Magen Avraham with the day starting 90 minutes before sunrise and ending 90 minutes after sunset. This is calculated
2092         * as 10.75 hours after {@link #getAlos90() dawn}. The formula used is 10.75 {@link #getShaahZmanis90Minutes()} after
2093         * {@link #getAlos90()}. Since <em>plag</em> by this calculation can occur after sunset, it should only be used
2094         * <em>lechumra</em>.
2095         * 
2096         * @deprecated This method should be used <em>lechumra</em> only since it returns a very late time (often after
2097         *         <em>shkiah</em>), and if used <em>lekula</em> can result in <em>chillul Shabbos</em> etc. There is no
2098         *         current plan to remove this method from the API, and this deprecation is intended to alert developers
2099         *         of the danger of using it.
2100         * 
2101         * @return the <code>Date</code> of the time of <em>plag hamincha</em>. If the calculation can't be computed such as
2102         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
2103         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
2104         *         {@link AstronomicalCalendar} documentation.
2105         * 
2106         * @see #getShaahZmanis90Minutes()
2107         */
2108        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
2109        public Date getPlagHamincha90Minutes() {
2110                return getPlagHamincha(getAlos90(), getTzais90(), true);
2111        }
2112
2113        /**
2114         * This method should be used <em>lechumra</em> only and returns the time of <em>plag hamincha</em> according to the Magen
2115         * Avraham with the day starting 96 minutes before sunrise and ending 96 minutes after sunset. This is calculated as 10.75
2116         * hours after {@link #getAlos96() dawn}. The formula used is 10.75 {@link #getShaahZmanis96Minutes()} after
2117         * {@link #getAlos96()}. Since <em>plag</em> by this calculation can occur after sunset, it should only be used
2118         * <em>lechumra</em>.
2119         * 
2120         * @deprecated This method should be used <em>lechumra</em> only since it returns a very late time (often after
2121         *         <em>shkiah</em>), and if used <em>lekula</em> can result in <em>chillul Shabbos</em> etc. There is no
2122         *         current plan to remove this method from the API, and this deprecation is intended to alert developers
2123         *         of the danger of using it.
2124         * 
2125         * @return the <code>Date</code> of the time of <em>plag hamincha</em>. If the calculation can't be computed such as
2126         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
2127         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
2128         *         {@link AstronomicalCalendar} documentation.
2129         * @see #getShaahZmanis96Minutes()
2130         */
2131        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
2132        public Date getPlagHamincha96Minutes() {
2133                return getPlagHamincha(getAlos96(), getTzais96(), true);
2134        }
2135
2136        /**
2137         * This method should be used <em>lechumra</em> only and returns the time of <em>plag hamincha</em>. This is calculated
2138         * as 10.75 hours after {@link #getAlos96Zmanis() dawn}. The formula used is 10.75 * {@link
2139         * #getShaahZmanis96MinutesZmanis()} after {@link #getAlos96Zmanis() dawn}. Since <em>plag</em> by this calculation can
2140         * occur after sunset, it should only be used <em>lechumra</em>.
2141         * 
2142         * @deprecated This method should be used <em>lechumra</em> only since it returns a very late time (often after
2143         *         <em>shkiah</em>), and if used <em>lekula</em> can result in <em>chillul Shabbos</em> etc. There is no
2144         *         current plan to remove this method from the API, and this deprecation is intended to alert developers
2145         *         of the danger of using it.
2146         * 
2147         * @return the <code>Date</code> of the time of <em>plag hamincha</em>. If the calculation can't be computed such as
2148         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
2149         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
2150         *         {@link AstronomicalCalendar} documentation.
2151         */
2152        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
2153        public Date getPlagHamincha96MinutesZmanis() {
2154                return getPlagHamincha(getAlos96Zmanis(), getTzais96Zmanis(), true);
2155        }
2156
2157        /**
2158         * This method should be used <em>lechumra</em> only and returns the time of <em>plag hamincha</em>. This is calculated
2159         * as 10.75 hours after {@link #getAlos90Zmanis() dawn}. The formula used is 10.75 * {@link
2160         * #getShaahZmanis90MinutesZmanis()} after {@link #getAlos90Zmanis() dawn}. Since <em>plag</em> by this calculation can
2161         * occur after sunset, it should only be used <em>lechumra</em>.
2162         * 
2163         * @deprecated This method should be used <em>lechumra</em> only since it returns a very late time (often after
2164         *         <em>shkiah</em>), and if used <em>lekula</em> can result in <em>chillul Shabbos</em> etc. There is no
2165         *         current plan to remove this method from the API, and this deprecation is intended to alert developers
2166         *         of the danger of using it.
2167         * 
2168         * @return the <code>Date</code> of the time of <em>plag hamincha</em>. If the calculation can't be computed such as
2169         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
2170         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
2171         *         {@link AstronomicalCalendar} documentation.
2172         */
2173        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
2174        public Date getPlagHamincha90MinutesZmanis() {
2175                return getPlagHamincha(getAlos90Zmanis(), getTzais90Zmanis(), true);
2176        }
2177
2178        /**
2179         * This method should be used <em>lechumra</em> only and returns the time of <em>plag hamincha</em>. This is calculated as
2180         * 10.75 hours after {@link #getAlos72Zmanis()}. The formula used is 10.75 * {@link #getShaahZmanis72MinutesZmanis()} after
2181         * {@link #getAlos72Zmanis() dawn}. Since <em>plag</em> by this calculation can occur after sunset, it should only be used
2182         * <em>lechumra</em>.
2183         * 
2184         * @deprecated This method should be used <em>lechumra</em> only since it returns a very late time (often after
2185         *         <em>shkiah</em>), and if used <em>lekula</em> can result in <em>chillul Shabbos</em> etc. There is no
2186         *         current plan to remove this method from the API, and this deprecation is intended to alert developers
2187         *         of the danger of using it.
2188         * 
2189         * @return the <code>Date</code> of the time of <em>plag hamincha</em>. If the calculation can't be computed such as
2190         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
2191         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
2192         *         {@link AstronomicalCalendar} documentation.
2193         */
2194        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
2195        public Date getPlagHamincha72MinutesZmanis() {
2196                return getPlagHamincha(getAlos72Zmanis(), getTzais72Zmanis(), true);
2197        }
2198
2199        /**
2200         * This method should be used <em>lechumra</em> only and returns the time of <em>plag hamincha</em> based on the
2201         * opinion that the day starts at {@link #getAlos16Point1Degrees() <em>alos</em> 16.1&deg;} and ends at {@link
2202         * #getTzais16Point1Degrees() <em>tzais</em> 16.1&deg;}. This is calculated as 10.75 hours <em>zmaniyos</em>
2203         * after {@link #getAlos16Point1Degrees() dawn}. The formula used is 10.75 * {@link #getShaahZmanis16Point1Degrees()}
2204         * after {@link #getAlos16Point1Degrees()}. Since <em>plag</em> by this calculation can occur after sunset, it
2205         * should only be used <em>lechumra</em>.
2206         * 
2207         * @deprecated This method should be used <em>lechumra</em> only since it returns a very late time (often after
2208         *         <em>shkiah</em>), and if used <em>lekula</em> can result in <em>chillul Shabbos</em> etc. There is no
2209         *         current plan to remove this method from the API, and this deprecation is intended to alert developers
2210         *         of the danger of using it.
2211         * 
2212         * @return the <code>Date</code> of the time of <em>plag hamincha</em>. If the calculation can't be computed such as
2213         *         northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle where
2214         *         the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be
2215         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
2216         * 
2217         * @see #getShaahZmanis16Point1Degrees()
2218         */
2219        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
2220        public Date getPlagHamincha16Point1Degrees() {
2221                return getPlagHamincha(getAlos16Point1Degrees(), getTzais16Point1Degrees(), true);
2222        }
2223
2224        /**
2225         * This method should be used <em>lechumra</em> only and returns the time of <em>plag hamincha</em> based on the
2226         * opinion that the day starts at {@link #getAlos19Point8Degrees() <em>alos</em> 19.8&deg;} and ends at {@link
2227         * #getTzais19Point8Degrees() <em>tzais</em> 19.8&deg;}. This is calculated as 10.75 hours <em>zmaniyos</em>
2228         * after {@link #getAlos19Point8Degrees() dawn}. The formula used is 10.75 * {@link
2229         * #getShaahZmanis19Point8Degrees()} after {@link #getAlos19Point8Degrees()}. Since <em>plag</em> by this
2230         * calculation can occur after sunset, it should only be used <em>lechumra</em>.
2231         * 
2232         * @deprecated This method should be used <em>lechumra</em> only since it returns a very late time (often after
2233         *         <em>shkiah</em>), and if used <em>lekula</em> can result in <em>chillul Shabbos</em> etc. There is no
2234         *         current plan to remove this method from the API, and this deprecation is intended to alert developers
2235         *         of the danger of using it.
2236         * 
2237         * @return the <code>Date</code> of the time of <em>plag hamincha</em>. If the calculation can't be computed such as
2238         *         northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle where
2239         *         the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be
2240         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
2241         * 
2242         * @see #getShaahZmanis19Point8Degrees()
2243         */
2244        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
2245        public Date getPlagHamincha19Point8Degrees() {
2246                return getPlagHamincha(getAlos19Point8Degrees(), getTzais19Point8Degrees(), true);
2247        }
2248
2249        /**
2250         * This method should be used <em>lechumra</em> only and returns the time of <em>plag hamincha</em> based on the
2251         * opinion that the day starts at {@link #getAlos26Degrees() <em>alos</em> 26&deg;} and ends at {@link
2252         * #getTzais26Degrees() <em>tzais</em> 26&deg;}. This is calculated as 10.75 hours <em>zmaniyos</em> after {@link
2253         * #getAlos26Degrees() dawn}. The formula used is 10.75 * {@link #getShaahZmanis26Degrees()} after {@link
2254         * #getAlos26Degrees()}. Since the <em>zman</em> based on an extremely early <em>alos</em> and a very late
2255         * <em>tzais</em>, it should only be used <em>lechumra</em>.
2256         * 
2257         * @deprecated This method should be used <em>lechumra</em> only since it returns a very late time (often after
2258         *         <em>shkiah</em>), and if used <em>lekula</em> can result in <em>chillul Shabbos</em> etc. There is no
2259         *         current plan to remove this method from the API, and this deprecation is intended to alert developers
2260         *         of the danger of using it.
2261         * 
2262         * @return the <code>Date</code> of the time of <em>plag hamincha</em>. If the calculation can't be computed such as
2263         *         northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle where
2264         *         the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be
2265         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
2266         * 
2267         * @see #getShaahZmanis26Degrees()
2268         * @see #getPlagHamincha120Minutes()
2269         */
2270        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
2271        public Date getPlagHamincha26Degrees() {
2272                return getPlagHamincha(getAlos26Degrees(), getTzais26Degrees(), true);
2273        }
2274
2275        /**
2276         * This method should be used <em>lechumra</em> only and returns the time of <em>plag hamincha</em> based on the
2277         * opinion that the day starts at {@link #getAlos18Degrees() <em>alos</em> 18&deg;} and ends at {@link
2278         * #getTzais18Degrees() <em>tzais</em> 18&deg;}. This is calculated as 10.75 hours <em>zmaniyos</em> after {@link
2279         * #getAlos18Degrees() dawn}. The formula used is 10.75 * {@link #getShaahZmanis18Degrees()} after {@link
2280         * #getAlos18Degrees()}. Since <em>plag</em> by this calculation can occur after sunset, it should only be used
2281         * <em>lechumra</em>.
2282         * 
2283         * @deprecated This method should be used <em>lechumra</em> only since it returns a very late time (often after
2284         *         <em>shkiah</em>), and if used <em>lekula</em> can result in <em>chillul Shabbos</em> etc. There is no
2285         *         current plan to remove this method from the API, and this deprecation is intended to alert developers
2286         *         of the danger of using it.
2287         * 
2288         * @return the <code>Date</code> of the time of <em>plag hamincha</em>. If the calculation can't be computed such as
2289         *         northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle where
2290         *         the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be
2291         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
2292         * 
2293         * @see #getShaahZmanis18Degrees()
2294         */
2295        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
2296        public Date getPlagHamincha18Degrees() {
2297                return getPlagHamincha(getAlos18Degrees(), getTzais18Degrees(), true);
2298        }
2299
2300        /**
2301         * This method should be used <em>lechumra</em> only and returns the time of <em>plag hamincha</em> based on the opinion
2302         * that the day starts at {@link #getAlos16Point1Degrees() <em>alos</em> 16.1&deg;} and ends at {@link #getSunset() sunset}.
2303         * 10.75 <em>shaos zmaniyos</em> are calculated based on this day and added to {@link #getAlos16Point1Degrees()
2304         * <em>alos</em>} to reach this time. This time is 10.75 <em>shaos zmaniyos</em> (temporal hours) after {@link
2305         * #getAlos16Point1Degrees() dawn} based on the opinion that the day is calculated from a {@link #getAlos16Point1Degrees()
2306         * dawn} of 16.1 degrees before sunrise to {@link #getSeaLevelSunset() sea level sunset}. This returns the time of 10.75 *
2307         * the calculated <em>shaah zmanis</em> after {@link #getAlos16Point1Degrees() dawn}. Since <em>plag</em> by this
2308         * calculation can occur after sunset, it should only be used <em>lechumra</em>.
2309         * 
2310         * 
2311         * @return the <code>Date</code> of the <em>plag</em>. If the calculation can't be computed such as northern and southern
2312         *         locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may not reach
2313         *         low enough below the horizon for this calculation, a <code>null</code> will be returned. See detailed
2314         *         explanation on top of the {@link AstronomicalCalendar} documentation.
2315         * 
2316         * @see #getAlos16Point1Degrees()
2317         * @see #getSeaLevelSunset()
2318         */
2319        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
2320        public Date getPlagAlosToSunset() {
2321                return getPlagHamincha(getAlos16Point1Degrees(), getElevationAdjustedSunset(), false);
2322        }
2323
2324        /**
2325         * This method returns the time of <em>plag hamincha</em> based on the opinion that the day starts at
2326         * {@link #getAlos16Point1Degrees() <em>alos</em> 16.1&deg;} and ends at {@link #getTzaisGeonim7Point083Degrees()
2327         * <em>tzais</em>}. 10.75 <em>shaos zmaniyos</em> are calculated based on this day and added to {@link
2328         * #getAlos16Point1Degrees() <em>alos</em>} to reach this time. This time is 10.75 <em>shaos zmaniyos</em> (temporal
2329         * hours) after {@link #getAlos16Point1Degrees() dawn} based on the opinion that the day is calculated from a
2330         * {@link #getAlos16Point1Degrees() dawn} of 16.1 degrees before sunrise to
2331         * {@link #getTzaisGeonim7Point083Degrees() <em>tzais</em>} . This returns the time of 10.75 * the calculated
2332         * <em>shaah zmanis</em> after {@link #getAlos16Point1Degrees() dawn}.
2333         * 
2334         * @return the <code>Date</code> of the <em>plag</em>. If the calculation can't be computed such as northern and
2335         *         southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may not
2336         *         reach low enough below the horizon for this calculation, a <code>null</code> will be returned. See
2337         *         detailed explanation on top of the {@link AstronomicalCalendar} documentation.
2338         * 
2339         * @see #getAlos16Point1Degrees()
2340         * @see #getTzaisGeonim7Point083Degrees()
2341         */
2342        public Date getPlagAlos16Point1ToTzaisGeonim7Point083Degrees() {
2343                return getPlagHamincha(getAlos16Point1Degrees(), getTzaisGeonim7Point083Degrees(), false);
2344        }
2345        
2346        /**
2347         * This method returns the time of <em>plag hamincha</em> (the earliest time that Shabbos can be started) based on the
2348         * opinion of <a href="https://en.wikipedia.org/wiki/Yaakov_Moshe_Hillel">Rabbi Yaakov Moshe Hillel</a> as published in
2349         * the <em>luach</em> of the Bais Horaah of Yeshivat Chevrat Ahavat Shalom that that <em>plag hamincha</em> is calculated
2350         * as 1.25 <em>shaos zmaniyos</em> before {@link #getTzaisGeonim3Point8Degrees() <em>tzais</em> 3.8&deg;} with <em>shaos
2351         * zmaniyos</em> calculated based on a day starting at {@link #getAlos16Point1Degrees() <em>alos</em> 16.1&deg;} and
2352         * ending at <em>tzais</em> 3.8&deg;.
2353         * 
2354         * @return the <code>Date</code> of the <em>plag</em>. If the calculation can't be computed such as northern and
2355         *         southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may not
2356         *         reach low enough below the horizon for this calculation, a <code>null</code> will be returned. See detailed
2357         *         explanation on top of the {@link AstronomicalCalendar} documentation.
2358         * 
2359         * @see #getShaahZmanisAlos16Point1ToTzais3Point8()
2360         * @see #getMinchaGedolaAhavatShalom()
2361         * @see #getMinchaKetanaAhavatShalom()
2362         */
2363        public Date getPlagAhavatShalom() {
2364                return getTimeOffset(getTzaisGeonim3Point8Degrees(), -getShaahZmanisAlos16Point1ToTzais3Point8() * 1.25);
2365        }
2366
2367        /**
2368         * Method to return the beginning of <em>bain hashmashos</em> of Rabbeinu Tam calculated when the sun is
2369         * {@link #ZENITH_13_POINT_24 13.24&deg;} below the western {@link #GEOMETRIC_ZENITH geometric horizon} (90&deg;)
2370         * after sunset. This calculation is based on the same calculation of {@link #getBainHashmashosRT58Point5Minutes()
2371         * <em>bain hashmashos</em> Rabbeinu Tam 58.5 minutes} but uses a degree-based calculation instead of 58.5 exact
2372         * minutes. This calculation is based on the position of the sun 58.5 minutes after sunset in Jerusalem <a href=
2373         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a>,
2374         * which calculates to 13.24&deg; below {@link #GEOMETRIC_ZENITH geometric zenith}.
2375         * NOTE: As per Yisrael Vehazmanim Vol. III page 1028, No. 50, a dip of slightly less than 13&deg; should be used.
2376         * Calculations show that the proper dip to be 13.2456&deg; (truncated to 13.24 that provides about 1.5 second
2377         * earlier (<em>lechumra</em>) time) below the horizon at that time. This makes a difference of 1 minute and 10
2378         * seconds in Jerusalem during the Equinox, and 1 minute 29 seconds during the solstice as compared to the proper
2379         * 13.24&deg; versus 13&deg;. For NY during the solstice, the difference is 1 minute 56 seconds.
2380         * @todo recalculate the above based on equilux/equinox calculations.
2381         * 
2382         * @return the <code>Date</code> of the sun being 13.24&deg; below {@link #GEOMETRIC_ZENITH geometric zenith}
2383         *         (90&deg;). If the calculation can't be computed such as northern and southern locations even south of the
2384         *         Arctic Circle and north of the Antarctic Circle where the sun may not reach low enough below the horizon
2385         *         for this calculation, a <code>null</code> will be returned. See detailed explanation on top of the
2386         *         {@link AstronomicalCalendar} documentation.
2387         * 
2388         * @see #ZENITH_13_POINT_24
2389         * @see #getBainHashmashosRT58Point5Minutes()
2390         */
2391        public Date getBainHashmashosRT13Point24Degrees() {
2392                return getSunsetOffsetByDegrees(ZENITH_13_POINT_24);
2393        }
2394        
2395
2396        /**
2397         * Misspelled method name that should be {@link #getBainHashmashosRT13Point24Degrees()}.
2398         * @return the properly spelled version.
2399         */
2400        @Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
2401        public Date getBainHasmashosRT13Point24Degrees() {
2402                return getBainHashmashosRT13Point24Degrees();
2403        }
2404
2405        /**
2406         * This method returns the beginning of <em>Bain hashmashos</em> of Rabbeinu Tam calculated as a 58.5-minute offset
2407         * after sunset. <em>bain hashmashos</em> is 3/4 of a <a href=
2408         * "https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a> before <em>tzais</em> or 3 1/4
2409         * mil after sunset. With a mil calculated as 18 minutes, 3.25 * 18 = 58.5 minutes.
2410         * 
2411         * @return the <code>Date</code> of 58.5 minutes after sunset. If the calculation can't be computed such as in the
2412         *         Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
2413         *         not set, a <code>null</code> will be returned. See detailed explanation on top of the
2414         *         {@link AstronomicalCalendar} documentation.
2415         * 
2416         */
2417        public Date getBainHashmashosRT58Point5Minutes() {
2418                return getTimeOffset(getElevationAdjustedSunset(), 58.5 * MINUTE_MILLIS);
2419        }
2420        
2421        /**
2422         * Misspelled method name that should be {@link #getBainHashmashosRT58Point5Minutes()}.
2423         * @return the properly spelled version.
2424         */
2425        @Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
2426        public Date getBainHasmashosRT58Point5Minutes() {
2427                return getBainHashmashosRT58Point5Minutes();
2428        }
2429
2430        /**
2431         * This method returns the beginning of <em>bain hashmashos</em> based on the calculation of 13.5 minutes (3/4 of an
2432         * 18-minute <a href="https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a>) before
2433         * <em>shkiah</em> calculated as {@link #getTzaisGeonim7Point083Degrees() 7.083&deg;}.
2434         * 
2435         * @return the <code>Date</code> of the <em>bain hashmashos</em> of Rabbeinu Tam in this calculation. If the
2436         *         calculation can't be computed such as northern and southern locations even south of the Arctic Circle and
2437         *         north of the Antarctic Circle where the sun may not reach low enough below the horizon for this
2438         *         calculation, a <code>null</code> will be returned. See detailed explanation on top of the
2439         *         {@link AstronomicalCalendar} documentation.
2440         * @see #getTzaisGeonim7Point083Degrees()
2441         */
2442        public Date getBainHashmashosRT13Point5MinutesBefore7Point083Degrees() {
2443                return getTimeOffset(getSunsetOffsetByDegrees(ZENITH_7_POINT_083), -13.5 * MINUTE_MILLIS);
2444        }
2445        
2446        /**
2447         * Misspelled method name that should be {@link #getBainHashmashosRT13Point5MinutesBefore7Point083Degrees()}.
2448         * @return the properly spelled version.
2449         */
2450        @Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
2451        public Date getBainHasmashosRT13Point5MinutesBefore7Point083Degrees() {
2452                return getBainHashmashosRT13Point5MinutesBefore7Point083Degrees();
2453        }
2454
2455        /**
2456         * This method returns the beginning of <em>bain hashmashos</em> of Rabbeinu Tam calculated according to the
2457         * opinion of the <em>Divrei Yosef</em> (see Yisrael Vehazmanim) calculated 5/18th (27.77%) of the time between
2458         * <em>alos</em> (calculated as 19.8&deg; before sunrise) and sunrise. This is added to sunset to arrive at the time
2459         * for <em>bain hashmashos</em> of Rabbeinu Tam.
2460         * 
2461         * @return the <code>Date</code> of <em>bain hashmashos</em> of Rabbeinu Tam for this calculation. If the
2462         *         calculation can't be computed such as northern and southern locations even south of the Arctic Circle and
2463         *         north of the Antarctic Circle where the sun may not reach low enough below the horizon for this
2464         *         calculation, a <code>null</code> will be returned. See detailed explanation on top of the
2465         *         {@link AstronomicalCalendar} documentation.
2466         */
2467        public Date getBainHashmashosRT2Stars() {
2468                Date alos19Point8 = getAlos19Point8Degrees();
2469                Date sunrise = getElevationAdjustedSunrise();
2470                if (alos19Point8 == null || sunrise == null) {
2471                        return null;
2472                }
2473                return getTimeOffset(getElevationAdjustedSunset(), (sunrise.getTime() - alos19Point8.getTime()) * (5 / 18d));
2474        }
2475        
2476        /**
2477         * Misspelled method name that should be {@link #getBainHashmashosRT2Stars()}.
2478         * @return the properly spelled version.
2479         */
2480        @Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
2481        public Date getBainHasmashosRT2Stars() {
2482                return getBainHashmashosRT2Stars();
2483        }
2484        
2485        /**
2486         * This method returns the beginning of <em>bain hashmashos</em> (twilight) according to the <a href=
2487         * "https://en.wikipedia.org/wiki/Eliezer_ben_Samuel">Yereim (Rabbi Eliezer of Metz)</a> calculated as 18 minutes
2488         * or 3/4 of a 24-minute <a href="https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement"
2489         * >mil</a> before sunset. According to the Yereim, <em>bain hashmashos</em> starts 3/4 of a mil before sunset and
2490         * <em>tzais</em> or nightfall starts at sunset.
2491         * 
2492         * @return the <code>Date</code> of 18 minutes before sunset. If the calculation can't be computed such as in the
2493         *         Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
2494         *         not set, a <code>null</code> will be returned. See detailed explanation on top of the
2495         *         {@link AstronomicalCalendar} documentation.
2496         * @see #getBainHashmashosYereim3Point05Degrees()
2497         */
2498        public Date getBainHashmashosYereim18Minutes() {
2499                return getTimeOffset(getElevationAdjustedSunset(), -18 * MINUTE_MILLIS);
2500        }
2501        
2502        /**
2503         * Misspelled method name that should be {@link #getBainHashmashosYereim18Minutes()}.
2504         * @return the properly spelled version.
2505         */
2506        @Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
2507        public Date getBainHasmashosYereim18Minutes() {
2508                return getBainHashmashosYereim18Minutes();
2509        }
2510        
2511        /**
2512         * This method returns the beginning of <em>bain hashmashos</em> (twilight) according to the <a href=
2513         * "https://en.wikipedia.org/wiki/Eliezer_ben_Samuel">Yereim (Rabbi Eliezer of Metz)</a> calculated as the sun's
2514         * position 3.05&deg; above the horizon <a href=
2515         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a>,
2516         * its position 18 minutes or 3/4 of an 24-minute <a href=
2517         * "https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a> before sunset. According to
2518         * the Yereim, <em>bain hashmashos</em> starts 3/4 of a mil before sunset and <em>tzais</em> or nightfall starts at
2519         * sunset. Note that <em>lechumra</em> (of about 14 seconds) a refraction value of 0.5166&deg; as opposed to the
2520         * traditional 0.566&deg; is used. This is more inline with the actual refraction in <em>Eretz Yisrael</em> and is
2521         * brought down by <a href=
2522         * "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
2523         * Yedidya Manet</a> in his <a href="https://www.nli.org.il/en/books/NNL_ALEPH002542826/NLI">Zmanei Halacha
2524         * Lema'aseh</a> (p. 11). That is the first source that I am aware of that calculates degree-based Yereim
2525         * <em>zmanim</em>. The 0.5166&deg; refraction is also used by the <a href="https://zmanim.online/">Luach Itim
2526         * Lebinah</a>. Calculating the Yereim's <em>bain hashmashos</em> using 18-minute based degrees is also suggested
2527         * in the upcoming 8th edition of the zmanim Kehilchasam. For more details, see the article <a href=
2528         * "https://kosherjava.com/2020/12/07/the-yereims-bein-hashmashos/">The Yereim's <em>Bein Hashmashos</em></a>.
2529         * 
2530         * @todo recalculate based on equinox/equilux
2531         * @return the <code>Date</code> of the sun's position 3.05&deg; minutes before sunset. If the calculation can't
2532         *         be computed such as in the Arctic Circle where there is at least one day a year where the sun does not
2533         *         rise, and one where it does not set, a <code>null</code> will be returned. See detailed explanation on
2534         *         top of the {@link AstronomicalCalendar} documentation.
2535         * 
2536         * @see #ZENITH_MINUS_3_POINT_05
2537         * @see #getBainHashmashosYereim18Minutes()
2538         * @see #getBainHashmashosYereim2Point8Degrees()
2539         * @see #getBainHashmashosYereim2Point1Degrees()
2540         */
2541        public Date getBainHashmashosYereim3Point05Degrees() {
2542                return getSunsetOffsetByDegrees(ZENITH_MINUS_3_POINT_05);
2543        }
2544        
2545        /**
2546         * Misspelled method name that should be {@link #getBainHashmashosYereim3Point05Degrees()}.
2547         * @return the properly spelled version.
2548         */
2549        @Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
2550        public Date getBainHasmashosYereim3Point05Degrees() {
2551                return getBainHashmashosYereim3Point05Degrees();
2552        }
2553        
2554        
2555        /**
2556         * This method returns the beginning of <em>bain hashmashos</em> (twilight) according to the <a href=
2557         * "https://en.wikipedia.org/wiki/Eliezer_ben_Samuel">Yereim (Rabbi Eliezer of Metz)</a> calculated as 16.875
2558         * minutes or 3/4 of a 22.5-minute <a href=
2559         * "https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a> before sunset. According
2560         * to the Yereim, <em>bain hashmashos</em> starts 3/4 of a mil before sunset and <em>tzais</em> or nightfall starts
2561         * at sunset.
2562         * 
2563         * @return the <code>Date</code> of 16.875 minutes before sunset. If the calculation can't be computed such as in the
2564         *         Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
2565         *         not set, a <code>null</code> will be returned. See detailed explanation on top of the
2566         *         {@link AstronomicalCalendar} documentation.
2567         * 
2568         * @see #getBainHashmashosYereim2Point8Degrees()
2569         */
2570        public Date getBainHashmashosYereim16Point875Minutes() {
2571                return getTimeOffset(getElevationAdjustedSunset(), -16.875 * MINUTE_MILLIS);
2572        }
2573        
2574        /**
2575         * Misspelled method name that should be {@link #getBainHashmashosYereim16Point875Minutes()}.
2576         * @return the properly spelled version.
2577         */
2578        @Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
2579        public Date getBainHasmashosYereim16Point875Minutes() {
2580                return getBainHashmashosYereim16Point875Minutes();
2581        }
2582        
2583        /**
2584         * This method returns the beginning of <em>bain hashmashos</em> (twilight) according to the <a href=
2585         * "https://en.wikipedia.org/wiki/Eliezer_ben_Samuel">Yereim (Rabbi Eliezer of Metz)</a> calculated as the sun's
2586         * position 2.8&deg; above the horizon <a href=
2587         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a>,
2588         * its position 16.875 minutes or 3/4 of an 18-minute <a href=
2589         * "https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a> before sunset. According to
2590         * the Yereim, <em>bain hashmashos</em> starts 3/4 of a mil before sunset and <em>tzais</em> or nightfall
2591         * starts at sunset. Details, including how the degrees were calculated can be seen in the documentation of
2592         * {@link #getBainHashmashosYereim3Point05Degrees()}.
2593         * 
2594         * @return the <code>Date</code> of the sun's position 2.8&deg; minutes before sunset. If the calculation can't
2595         *         be computed such as in the Arctic Circle where there is at least one day a year where the sun does not
2596         *         rise, and one where it does not set, a <code>null</code> will be returned. See detailed explanation on
2597         *         top of the {@link AstronomicalCalendar} documentation.
2598         * 
2599         * @see #ZENITH_MINUS_2_POINT_8
2600         * @see #getBainHashmashosYereim16Point875Minutes()
2601         * @see #getBainHashmashosYereim3Point05Degrees()
2602         * @see #getBainHashmashosYereim2Point1Degrees()
2603         */
2604        public Date getBainHashmashosYereim2Point8Degrees() {
2605                return getSunsetOffsetByDegrees(ZENITH_MINUS_2_POINT_8);
2606        }
2607        
2608        /**
2609         * Misspelled method name that should be {@link #getBainHashmashosYereim2Point8Degrees()}.
2610         * @return the properly spelled version.
2611         */
2612        @Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
2613        public Date getBainHasmashosYereim2Point8Degrees() {
2614                return getBainHashmashosYereim2Point8Degrees();
2615        }
2616        
2617        
2618        /**
2619         * This method returns the beginning of <em>bain hashmashos</em> (twilight) according to the <a href=
2620         * "https://en.wikipedia.org/wiki/Eliezer_ben_Samuel">Yereim (Rabbi Eliezer of Metz)</a> calculated as 13.5 minutes
2621         * or 3/4 of an 18-minute <a href="https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a>
2622         * before sunset. According to the Yereim, <em>bain hashmashos</em> starts 3/4 of a mil before sunset and
2623         * <em>tzais</em> or nightfall starts at sunset.
2624         * 
2625         * @return the <code>Date</code> of 13.5 minutes before sunset. If the calculation can't be computed such as in the
2626         *         Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
2627         *         not set, a <code>null</code> will be returned. See detailed explanation on top of the
2628         *         {@link AstronomicalCalendar} documentation.
2629         * 
2630         * @see #getBainHashmashosYereim2Point1Degrees()
2631         */
2632        public Date getBainHashmashosYereim13Point5Minutes() {
2633                return getTimeOffset(getElevationAdjustedSunset(), -13.5 * MINUTE_MILLIS);
2634        }
2635        
2636        /**
2637         * Misspelled method name that should be {@link #getBainHashmashosYereim13Point5Minutes()}.
2638         * @return the properly spelled version.
2639         */
2640        @Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
2641        public Date getBainHasmashosYereim13Point5Minutes() {
2642                return getBainHashmashosYereim13Point5Minutes();
2643        }
2644        
2645        /**
2646         * This method returns the beginning of <em>bain hashmashos</em> according to the <a href=
2647         * "https://en.wikipedia.org/wiki/Eliezer_ben_Samuel">Yereim (Rabbi Eliezer of Metz)</a> calculated as the sun's
2648         * position 2.1&deg; above the horizon <a href=
2649         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a> in
2650         * Yerushalayim, its position 13.5 minutes or 3/4 of an 18-minute <a href=
2651         * "https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a> before sunset. According to the
2652         * Yereim, <em>bain hashmashos</em> starts 3/4 of a mil before sunset and <em>tzais</em> or nightfall starts
2653         * at sunset. Details, including how the degrees were calculated can be seen in the documentation of
2654         * {@link #getBainHashmashosYereim3Point05Degrees()}.
2655         * 
2656         * @return the <code>Date</code> of the sun's position 2.1&deg; minutes before sunset. If the calculation can't be
2657         *         computed such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and
2658         *         one where it does not set, a <code>null</code> will be returned. See detailed explanation on top of the
2659         *         {@link AstronomicalCalendar} documentation.
2660         * 
2661         * @see #ZENITH_MINUS_2_POINT_1
2662         * @see #getBainHashmashosYereim13Point5Minutes()
2663         * @see #getBainHashmashosYereim2Point8Degrees()
2664         * @see #getBainHashmashosYereim3Point05Degrees()
2665         */
2666        public Date getBainHashmashosYereim2Point1Degrees() {
2667                return getSunsetOffsetByDegrees(ZENITH_MINUS_2_POINT_1);
2668        }
2669        
2670        /**
2671         * Misspelled method name that should be {@link #getBainHashmashosYereim2Point1Degrees()}.
2672         * @return the properly spelled version.
2673         */
2674        @Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
2675        public Date getBainHasmashosYereim2Point1Degrees() {
2676                return getBainHashmashosYereim2Point1Degrees();
2677        }
2678        
2679        /**
2680         * This method returns the <em>tzais</em> (nightfall) based on the opinion of the <em>Geonim</em> calculated at the
2681         * sun's position at {@link #ZENITH_3_POINT_7 3.7&deg;} below the western horizon.
2682         * 
2683         * @return the <code>Date</code> representing the time when the sun is 3.7&deg; below sea level.
2684         * @see #ZENITH_3_POINT_7
2685         */
2686        public Date getTzaisGeonim3Point7Degrees() {
2687                return getSunsetOffsetByDegrees(ZENITH_3_POINT_7);
2688        }
2689
2690        /**
2691         * This method returns the <em>tzais</em> (nightfall) based on the opinion of the <em>Geonim</em> calculated at the
2692         * sun's position at {@link #ZENITH_3_POINT_8 3.8&deg;} below the western horizon.
2693         * 
2694         * @return the <code>Date</code> representing the time when the sun is 3.8&deg; below sea level.
2695         * @see #ZENITH_3_POINT_8
2696         */
2697        public Date getTzaisGeonim3Point8Degrees() {
2698                return getSunsetOffsetByDegrees(ZENITH_3_POINT_8);
2699        }
2700
2701        /**
2702         * This method returns the <em>tzais</em> (nightfall) based on the opinion of the <em>Geonim</em> calculated at the
2703         * sun's position at {@link #ZENITH_5_POINT_95 5.95&deg;} below the western horizon.
2704         * 
2705         * @return the <code>Date</code> representing the time when the sun is 5.95&deg; below sea level. If the calculation
2706         *         can't be computed such as northern and southern locations even south of the Arctic Circle and north of
2707         *         the Antarctic Circle where the sun may not reach low enough below the horizon for this calculation, a
2708         *         <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
2709         *         documentation.
2710         * @see #ZENITH_5_POINT_95
2711         */
2712        public Date getTzaisGeonim5Point95Degrees() {
2713                return getSunsetOffsetByDegrees(ZENITH_5_POINT_95);
2714        }
2715
2716        /**
2717         * This method returns the <em>tzais</em> (nightfall) based on the opinion of the <em>Geonim</em> calculated as 3/4
2718         * of a <a href="https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a> based on an
2719         * 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
2720         * horizon. This is a very early <em>zman</em> and should not be relied on without Rabbinical guidance.
2721         * 
2722         * @return the <code>Date</code> representing the time when the sun is 3.65&deg; below sea level. If the calculation
2723         *         can't be computed such as northern and southern locations even south of the Arctic Circle and north of
2724         *         the Antarctic Circle where the sun may not reach low enough below the horizon for this calculation, a
2725         *         <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
2726         *         documentation.
2727         * @deprecated This will be removed in v3.0.0 since calculations show that this time is earlier than 13.5 minutes at
2728         *              the <a href="https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the
2729         *              equinox / equilux</a> in Jerusalem.
2730         * @see #ZENITH_3_POINT_65
2731         */
2732        @Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
2733        public Date getTzaisGeonim3Point65Degrees() {
2734                return getSunsetOffsetByDegrees(ZENITH_3_POINT_65);
2735        }
2736
2737        /**
2738         * This method returns the <em>tzais</em> (nightfall) based on the opinion of the <em>Geonim</em> calculated as 3/4
2739         * of a <a href="https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a> based on an
2740         * 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
2741         * horizon based on the calculations of Stanley Fishkind. This is a very early <em>zman</em> and should not be
2742         * relied on without Rabbinical guidance.
2743         * 
2744         * @return the <code>Date</code> representing the time when the sun is 3.676&deg; below sea level. If the
2745         *         calculation can't be computed such as northern and southern locations even south of the Arctic Circle and
2746         *         north of the Antarctic Circle where the sun may not reach low enough below the horizon for this
2747         *         calculation, a <code>null</code> will be returned. See detailed explanation on top of the
2748         *         {@link AstronomicalCalendar} documentation.
2749         * @deprecated This will be removed in v3.0.0 since calculations show that this time is earlier than 13.5 minutes at
2750         *              the <a href="https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the
2751         *              equinox / equilux</a> in Jerusalem.
2752         * @see #ZENITH_3_POINT_676
2753         */
2754        @Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
2755        public Date getTzaisGeonim3Point676Degrees() {
2756                return getSunsetOffsetByDegrees(ZENITH_3_POINT_676);
2757        }
2758
2759        /**
2760         * This method returns the <em>tzais</em> (nightfall) based on the opinion of the <em>Geonim</em> calculated as 3/4
2761         * of a <a href="https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a> based on a
2762         * 24-minute mil, or 18 minutes. It is the sun's position at {@link #ZENITH_4_POINT_61 4.61&deg;} below the
2763         * western horizon. This is a very early <em>zman</em> and should not be relied on without Rabbinical guidance.
2764         * 
2765         * @return the <code>Date</code> representing the time when the sun is 4.61&deg; below sea level. If the calculation
2766         *         can't be computed such as northern and southern locations even south of the Arctic Circle and north of
2767         *         the Antarctic Circle where the sun may not reach low enough below the horizon for this calculation, a
2768         *         <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
2769         *         documentation.
2770         * @see #ZENITH_4_POINT_61
2771         */
2772        public Date getTzaisGeonim4Point61Degrees() {
2773                return getSunsetOffsetByDegrees(ZENITH_4_POINT_61);
2774        }
2775
2776        /**
2777         * This method returns the <em>tzais</em> (nightfall) based on the opinion of the <em>Geonim</em> calculated as 3/4
2778         * of a <a href="https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a>, based on a
2779         * 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
2780         * horizon. This is a very early <em>zman</em> and should not be relied on without Rabbinical guidance.
2781         * 
2782         * @return the <code>Date</code> representing the time when the sun is 4.37&deg; below sea level. If the calculation
2783         *         can't be computed such as northern and southern locations even south of the Arctic Circle and north of
2784         *         the Antarctic Circle where the sun may not reach low enough below the horizon for this calculation, a
2785         *         <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
2786         *         documentation.
2787         * @see #ZENITH_4_POINT_37
2788         */
2789        public Date getTzaisGeonim4Point37Degrees() {
2790                return getSunsetOffsetByDegrees(ZENITH_4_POINT_37);
2791        }
2792
2793        /**
2794         * This method returns the <em>tzais</em> (nightfall) based on the opinion of the <em>Geonim</em> calculated as 3/4
2795         * of a 24-minute <a href="https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a>,
2796         * based on a mil being 24 minutes, and is calculated as 18 + 2 + 4 for a total of 24 minutes. It is the
2797         * sun's position at {@link #ZENITH_5_POINT_88 5.88&deg;} below the western horizon. This is a very early
2798         * <em>zman</em> and should not be relied on without Rabbinical guidance.
2799         * 
2800         * @todo Additional detailed documentation needed.
2801         * @return the <code>Date</code> representing the time when the sun is 5.88&deg; below sea level. If the calculation
2802         *         can't be computed such as northern and southern locations even south of the Arctic Circle and north of
2803         *         the Antarctic Circle where the sun may not reach low enough below the horizon for this calculation, a
2804         *         <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
2805         *         documentation.
2806         * @see #ZENITH_5_POINT_88
2807         */
2808        public Date getTzaisGeonim5Point88Degrees() {
2809                return getSunsetOffsetByDegrees(ZENITH_5_POINT_88);
2810        }
2811
2812        /**
2813         * This method returns the <em>tzais</em> (nightfall) based on the opinion of the <em>Geonim</em> calculated as 3/4
2814         * of a <a href="https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a> based on the
2815         * sun's position at {@link #ZENITH_4_POINT_8 4.8&deg;} below the western horizon. This is based on Rabbi Leo Levi's
2816         * calculations. This is a very early <em>zman</em> and should not be relied on without Rabbinical guidance.
2817         * @todo Additional documentation needed.
2818         * 
2819         * @return the <code>Date</code> representing the time when the sun is 4.8&deg; below sea level. If the calculation
2820         *         can't be computed such as northern and southern locations even south of the Arctic Circle and north of
2821         *         the Antarctic Circle where the sun may not reach low enough below the horizon for this calculation, a
2822         *         <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
2823         *         documentation.
2824         * @see #ZENITH_4_POINT_8
2825         */
2826        public Date getTzaisGeonim4Point8Degrees() {
2827                return getSunsetOffsetByDegrees(ZENITH_4_POINT_8);
2828        }
2829        
2830        
2831        /**
2832         * This method returns the <em>tzais</em> (nightfall) based on the opinion of the <em>Geonim</em> as calculated by
2833         * <a href="https://en.wikipedia.org/wiki/Yechiel_Michel_Tucazinsky">Rabbi Yechiel Michel Tucazinsky</a>. It is
2834         * based on of the position of the sun no later than {@link #getTzaisGeonim6Point45Degrees() 31 minutes} after sunset
2835         * in Jerusalem the height of the summer solstice and is 28 minutes after <em>shkiah</em> <a href=
2836         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a>. This
2837         * computes to 6.45&deg; below the western horizon.
2838         * @todo Additional documentation details needed.
2839         * 
2840         * @return the <code>Date</code> representing the time when the sun is 6.45&deg; below sea level. If the
2841         *         calculation can't be computed such as northern and southern locations even south of the Arctic Circle and
2842         *         north of the Antarctic Circle where the sun may not reach low enough below the horizon for this
2843         *         calculation, a <code>null</code> will be returned. See detailed explanation on top of the
2844         *         {@link AstronomicalCalendar} documentation.
2845         * @see #ZENITH_6_POINT_45
2846         */
2847        public Date getTzaisGeonim6Point45Degrees() {
2848                return getSunsetOffsetByDegrees(ZENITH_6_POINT_45);
2849        }
2850
2851        /**
2852         * This method returns the <em>tzais</em> (nightfall) based on the opinion of the <em>Geonim</em> calculated when the
2853         * sun's position {@link #ZENITH_7_POINT_083 7.083&deg; (or 7&deg; 5\u2032}) below the western horizon. This is often
2854         * referred to as 7&deg;5' or 7&deg; and 5 minutes. This calculation is based on the observation of 3 medium-sized
2855         * stars by Dr. Baruch (Berthold) Cohn in his <em>luach</em> <a href=
2856         * "https://sammlungen.ub.uni-frankfurt.de/freimann/content/titleinfo/983088">Tabellen enthaltend die Zeitangaben für
2857         * den Beginn der Nacht und des Tages für die Breitengrade + 66 bis -38</a> published in Strasbourg, France in 1899.
2858         * This calendar was very popular in Europe, and many other calendars based their time on it. <a href=
2859         * "https://en.wikipedia.org/wiki/David_Zvi_Hoffmann">Rav Dovid Tzvi Hoffman</a> in his
2860         * <a href="https://hebrewbooks.org/1053">Sh"Ut Melamed Leho'il</a> in an exchange of letters with Baruch Cohn in <a href=
2861         * "https://hebrewbooks.org/pdfpager.aspx?req=1053&st=&pgnum=37">Orach Chaim 30</a> agreed to this <em>zman</em> (page 36),
2862         * as did the Sh"Ut Bnei Tziyon and the Tenuvas Sadeh. It is very close to the time of the <a href=
2863         * "https://hebrewbooks.org/22044">Mekor Chesed</a> of the Sefer chasidim. It is close to the position of the sun 30 minutes
2864         * after sunset in Jerusalem <a href=
2865         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a>, but not
2866         * Exactly. The actual position of the sun 30 minutes after sunset in Jerusalem at the equilux is 7.205&deg; and 7.199&deg;
2867         * at the equinox. See Hazmanim Bahalacha vol 2, pages 520-521 for more details.
2868         * 
2869         * @return the <code>Date</code> representing the time when the sun is 7.083&deg; below sea level. If the
2870         *         calculation can't be computed such as northern and southern locations even south of the Arctic Circle and
2871         *         north of the Antarctic Circle where the sun may not reach low enough below the horizon for this
2872         *         calculation, a <code>null</code> will be returned. See detailed explanation on top of the
2873         *         {@link AstronomicalCalendar} documentation.
2874         * @see #ZENITH_7_POINT_083
2875         */
2876        public Date getTzaisGeonim7Point083Degrees() {
2877                return getSunsetOffsetByDegrees(ZENITH_7_POINT_083);
2878        }
2879        
2880        /**
2881         * This method returns <em>tzais</em> (nightfall) based on the opinion of the <em>Geonim</em> calculated as 45 minutes
2882         * after sunset during the summer solstice in New York, when the <em>neshef</em> (twilight) is the longest. The sun's
2883         * position at this time computes to {@link #ZENITH_7_POINT_67 7.75&deg;} below the western horizon. See <a href=
2884         * "https://hebrewbooks.org/pdfpager.aspx?req=921&pgnum=149">Igros Moshe Even Haezer 4, Ch. 4</a> (regarding
2885         * <em>tzais</em> for <em>krias Shema</em>). It is also mentioned in Rabbi Heber's <a href=
2886         * "https://hebrewbooks.org/53000">Shaarei Zmanim</a> on in
2887         * <a href="https://hebrewbooks.org/pdfpager.aspx?req=53055&pgnum=101">chapter 10 (page 87)</a> and
2888         * <a href="https://hebrewbooks.org/pdfpager.aspx?req=53055&pgnum=122">chapter 12 (page 108)</a>. Also see the
2889         * time of 45 minutes in <a href="https://en.wikipedia.org/wiki/Simcha_Bunim_Cohen">Rabbi Simcha Bunim Cohen's</a> <a
2890         * href="https://www.worldcat.org/oclc/179728985">The radiance of Shabbos</a> as the earliest <em>zman</em> for New York.
2891         * This <em>zman</em> is also listed in the <a href="https://hebrewbooks.org/pdfpager.aspx?req=1927&pgnum=90">Divrei
2892         * Shalom Vol. III, chapter 75</a>, and <a href="https://hebrewbooks.org/pdfpager.aspx?req=892&pgnum=431">Bais Av"i
2893         * Vol. III, chapter 117</a>. This <em>zman</em> is also listed in the Divrei Shalom etc. chapter 177 (FIXME - could not
2894         * be located). Since this <em>zman</em> depends on the level of light, Rabbi Yaakov Shakow presented this degree-based
2895         * calculation to Rabbi <a href="https://en.wikipedia.org/wiki/Shmuel_Kamenetsky">Rabbi Shmuel Kamenetsky</a> who agreed
2896         * to it.
2897         * @todo add hyperlinks to source of Divrei Shalom once it is located.
2898         * @return the <code>Date</code> representing the time when the sun is 7.67&deg; below sea level. If the
2899         *         calculation can't be computed such as northern and southern locations even south of the Arctic Circle and
2900         *         north of the Antarctic Circle where the sun may not reach low enough below the horizon for this
2901         *         calculation, a <code>null</code> will be returned. See detailed explanation on top of the
2902         *         {@link AstronomicalCalendar} documentation.
2903         * @see #ZENITH_7_POINT_67
2904         */
2905        public Date getTzaisGeonim7Point67Degrees() {
2906                return getSunsetOffsetByDegrees(ZENITH_7_POINT_67);
2907        }
2908
2909        /**
2910         * This method returns the <em>tzais</em> (nightfall) based on the opinion of the <em>Geonim</em> calculated at the
2911         * sun's position at {@link #ZENITH_8_POINT_5 8.5&deg;} below the western horizon.
2912         * 
2913         * @return the <code>Date</code> representing the time when the sun is 8.5&deg; below sea level. If the calculation
2914         *         can't be computed such as northern and southern locations even south of the Arctic Circle and north of
2915         *         the Antarctic Circle where the sun may not reach low enough below the horizon for this calculation, a
2916         *         <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
2917         *         documentation.
2918         * @see #ZENITH_8_POINT_5
2919         */
2920        public Date getTzaisGeonim8Point5Degrees() {
2921                return getSunsetOffsetByDegrees(ZENITH_8_POINT_5);
2922        }
2923        
2924        /**
2925         * This method returns the <em>tzais</em> (nightfall) based on the calculations used in the <a href=
2926         * "https://www.worldcat.org/oclc/243303103">Luach Itim Lebinah</a> as the stringent time for <em>tzais</em>.  It is
2927         * calculated at the sun's position at {@link #ZENITH_9_POINT_3 9.3&deg;} below the western horizon.
2928         * 
2929         * @return the <code>Date</code> representing the time when the sun is 9.3&deg; below sea level. If the calculation
2930         *         can't be computed such as northern and southern locations even south of the Arctic Circle and north of
2931         *         the Antarctic Circle where the sun may not reach low enough below the horizon for this calculation, a
2932         *         <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
2933         *         documentation.
2934         */
2935        public Date getTzaisGeonim9Point3Degrees() {
2936                return getSunsetOffsetByDegrees(ZENITH_9_POINT_3);
2937        }
2938        
2939        /**
2940         * This method returns the <em>tzais</em> (nightfall) based on the opinion of the <em>Geonim</em> calculated as 60
2941         * minutes after sunset <a href=
2942         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a>, the
2943         * day that a solar hour is 60 minutes in New York. The sun's position at this time computes to
2944         * {@link #ZENITH_9_POINT_75 9.75&deg;} below the western horizon. This is the opinion of <a href=
2945         * "https://en.wikipedia.org/wiki/Yosef_Eliyahu_Henkin">Rabbi Eliyahu Henkin</a>.  This also follows the opinion of
2946         * <a href="https://en.wikipedia.org/wiki/Shmuel_Kamenetsky">Rabbi Shmuel Kamenetsky</a>. Rabbi Yaakov Shakow presented
2947         * these degree-based times to Rabbi Shmuel Kamenetsky who agreed to them.
2948         * 
2949         * @todo recalculate based on equinox / equilux.
2950         * @return the <code>Date</code> representing the time when the sun is 9.75&deg; below sea level. If the calculation
2951         *         can't be computed such as northern and southern locations even south of the Arctic Circle and north of
2952         *         the Antarctic Circle where the sun may not reach low enough below the horizon for this calculation, a
2953         *         <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
2954         *         documentation.
2955         *
2956         * @see #getTzais60()
2957         */
2958        public Date getTzaisGeonim9Point75Degrees() {
2959                return getSunsetOffsetByDegrees(ZENITH_9_POINT_75);
2960        }
2961
2962        /**
2963         * This method returns the <em>tzais</em> (nightfall) based on the opinion of the <a href=
2964         * "https://en.wikipedia.org/wiki/Yair_Bacharach">Chavas Yair</a> and <a href=
2965         * "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"
2966         * >Divrei Malkiel</a> that the time to walk the distance of a <a href=
2967         * "https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a> is 15 minutes, for a total of 60 minutes
2968         * for 4 mil after {@link #getSeaLevelSunset() sea level sunset}. See detailed documentation explaining the 60 minute concept at
2969         * {@link #getAlos60()}.
2970         * 
2971         * @return the <code>Date</code> representing 60 minutes after sea level sunset. If the calculation can't be
2972         *         computed such as in the Arctic Circle where there is at least one day a year where the sun does not rise,
2973         *         and one where it does not set, a <code>null</code> will be returned. See detailed explanation on top of the
2974         *         {@link AstronomicalCalendar} documentation.
2975         * 
2976         * @see #getAlos60()
2977         * @see #getPlagHamincha60Minutes()
2978         * @see #getShaahZmanis60Minutes()
2979         */
2980        public Date getTzais60() {
2981                return getTimeOffset(getElevationAdjustedSunset(), 60 * MINUTE_MILLIS);
2982        }
2983
2984        /**
2985         * This method returns <em>tzais</em> usually calculated as 40 minutes (configurable to any offset via
2986         * {@link #setAteretTorahSunsetOffset(double)}) after sunset. Please note that <em>Chacham</em> Yosef Harari-Raful
2987         * of Yeshivat Ateret Torah who uses this time, does so only for calculating various other <em>zmanei hayom</em>
2988         * such as <em>Sof Zman Krias Shema</em> and <em>Plag Hamincha</em>. His calendars do not publish a <em>zman</em>
2989         * for <em>Tzais</em>. It should also be noted that <em>Chacham</em> Harari-Raful provided a 25 minute <em>zman</em>
2990         * for Israel. This API uses 40 minutes year round in any place on the globe by default. This offset can be changed
2991         *  by calling {@link #setAteretTorahSunsetOffset(double)}.
2992         * 
2993         * @return the <code>Date</code> representing 40 minutes (configurable via {@link #setAteretTorahSunsetOffset})
2994         *         after sea level sunset. If the calculation can't be computed such as in the Arctic Circle where there is
2995         *         at least one day a year where the sun does not rise, and one where it does not set, a <code>null</code> will
2996         *         be returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
2997         * @see #getAteretTorahSunsetOffset()
2998         * @see #setAteretTorahSunsetOffset(double)
2999         */
3000        public Date getTzaisAteretTorah() {
3001                return getTimeOffset(getElevationAdjustedSunset(), getAteretTorahSunsetOffset() * MINUTE_MILLIS);
3002        }
3003
3004        /**
3005         * Returns the offset in minutes after sunset used to calculate <em>tzais</em> based on the calculations of
3006         * <em>Chacham</em> Yosef Harari-Raful of Yeshivat Ateret Torah calculations. The default value is 40 minutes.
3007         * This affects most <em>zmanim</em>, since almost all zmanim use subset as part of their calculation.
3008         * 
3009         * @return the number of minutes after sunset for <em>Tzait</em>.
3010         * @see #setAteretTorahSunsetOffset(double)
3011         */
3012        public double getAteretTorahSunsetOffset() {
3013                return ateretTorahSunsetOffset;
3014        }
3015
3016        /**
3017         * Allows setting the offset in minutes after sunset for the Ateret Torah <em>zmanim</em>. The default if unset is
3018         * 40 minutes. <em>Chacham</em> Yosef Harari-Raful of Yeshivat Ateret Torah uses 40 minutes globally with the exception
3019         * of Israel where a 25-minute offset is used. This 40-minute (or any other) offset can be overridden by this method.
3020         * This offset impacts all Ateret Torah <em>zmanim</em>.
3021         * 
3022         * @param ateretTorahSunsetOffset
3023         *            the number of minutes after sunset to use as an offset for the Ateret Torah <em>tzais</em>
3024         * @see #getAteretTorahSunsetOffset()
3025         */
3026        public void setAteretTorahSunsetOffset(double ateretTorahSunsetOffset) {
3027                this.ateretTorahSunsetOffset = ateretTorahSunsetOffset;
3028        }
3029
3030        /**
3031         * This method returns the latest <em>zman krias shema</em> (time to recite Shema in the morning) based on the
3032         * calculation of <em>Chacham</em> Yosef Harari-Raful of Yeshivat Ateret Torah, that the day starts
3033         * {@link #getAlos72Zmanis() 1/10th of the day} before sunrise and is usually calculated as ending
3034         * {@link #getTzaisAteretTorah() 40 minutes after sunset} (configurable to any offset via
3035         * {@link #setAteretTorahSunsetOffset(double)}). <em>shaos zmaniyos</em> are calculated based on this day and added
3036         * to {@link #getAlos72Zmanis() <em>alos</em>} to reach this time. This time is 3
3037         * {@link #getShaahZmanisAteretTorah() <em>shaos zmaniyos</em>} (temporal hours) after
3038         * {@link #getAlos72Zmanis() <em>alos</em> 72 <em>zmaniyos</em>}. <b>Note: </b> Based on this calculation <em>chatzos</em>
3039         * will not be at midday.
3040         * 
3041         * @return the <code>Date</code> of the latest <em>zman krias shema</em> based on this calculation. If the
3042         *         calculation can't be computed such as in the Arctic Circle where there is at least one day a year where
3043         *         the sun does not rise, and one where it does not set, a <code>null</code> will be returned. See detailed
3044         *         explanation on top of the {@link AstronomicalCalendar} documentation.
3045         * @see #getAlos72Zmanis()
3046         * @see #getTzaisAteretTorah()
3047         * @see #getAteretTorahSunsetOffset()
3048         * @see #setAteretTorahSunsetOffset(double)
3049         * @see #getShaahZmanisAteretTorah()
3050         */
3051        public Date getSofZmanShmaAteretTorah() {
3052                return getSofZmanShma(getAlos72Zmanis(), getTzaisAteretTorah(), false);
3053        }
3054
3055        /**
3056         * This method returns the latest <em>zman tfila</em> (time to recite the morning prayers) based on the calculation
3057         * of <em>Chacham</em> Yosef Harari-Raful of Yeshivat Ateret Torah, that the day starts {@link #getAlos72Zmanis()
3058         * 1/10th of the day} before sunrise and is usually calculated as ending {@link #getTzaisAteretTorah() 40 minutes
3059         * after sunset} (configurable to any offset via {@link #setAteretTorahSunsetOffset(double)}). <em>shaos zmaniyos</em>
3060         * are calculated based on this day and added to {@link #getAlos72Zmanis() <em>alos</em>} to reach this time. This time
3061         * is 4 * {@link #getShaahZmanisAteretTorah() <em>shaos zmaniyos</em>} (temporal hours) after
3062         * {@link #getAlos72Zmanis() <em>alos</em> 72 zmaniyos}.
3063         * <b>Note: </b> Based on this calculation <em>chatzos</em> will not be at midday.
3064         * 
3065         * @return the <code>Date</code> of the latest <em>zman krias shema</em> based on this calculation. If the
3066         *         calculation can't be computed such as in the Arctic Circle where there is at least one day a year where
3067         *         the sun does not rise, and one where it does not set, a <code>null</code> will be returned. See detailed
3068         *         explanation on top of the {@link AstronomicalCalendar} documentation.
3069         * @see #getAlos72Zmanis()
3070         * @see #getTzaisAteretTorah()
3071         * @see #getShaahZmanisAteretTorah()
3072         * @see #setAteretTorahSunsetOffset(double)
3073         */
3074        public Date getSofZmanTfilaAteretTorah() {
3075                return getSofZmanTfila(getAlos72Zmanis(), getTzaisAteretTorah(), false);
3076        }
3077        
3078        /**
3079         * @see #getSofZmanTfilaAteretTorah()
3080         * @deprecated misspelled method name (all other methods spell tfila without an H) to be removed in 3.0.0.
3081         * @return the <code>Date</code> of the latest <em>zman krias shema</em> based on this calculation. If the
3082         *         calculation can't be computed such as in the Arctic Circle where there is at least one day a year where
3083         *         the sun does not rise, and one where it does not set, a <code>null</code> will be returned. See detailed
3084         *         explanation on top of the {@link AstronomicalCalendar} documentation.
3085         */
3086        @Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
3087        public Date getSofZmanTfilahAteretTorah() {
3088                return getSofZmanTfila(getAlos72Zmanis(), getTzaisAteretTorah(), false);
3089        }
3090
3091        /**
3092         * This method returns the time of <em>mincha gedola</em> based on the calculation of <em>Chacham</em> Yosef
3093         * Harari-Raful of Yeshivat Ateret Torah, that the day starts {@link #getAlos72Zmanis() 1/10th of the day}
3094         * before sunrise and is usually calculated as ending {@link #getTzaisAteretTorah() 40 minutes after sunset}
3095         * (configurable to any offset via {@link #setAteretTorahSunsetOffset(double)}). This is the preferred earliest
3096         * time to pray <em>mincha</em> according to the opinion of the <a href="https://en.wikipedia.org/wiki/Maimonides"
3097         * >Rambam</a> and others. For more information on this see the documentation on {@link #getMinchaGedola() <em>mincha
3098         * gedola</em>}. This is calculated as 6.5 {@link #getShaahZmanisAteretTorah()  solar hours} after <em>alos</em>. The
3099         * calculation used is 6.5 * {@link #getShaahZmanisAteretTorah()} after {@link #getAlos72Zmanis() <em>alos</em>}.
3100         * 
3101         * @see #getAlos72Zmanis()
3102         * @see #getTzaisAteretTorah()
3103         * @see #getShaahZmanisAteretTorah()
3104         * @see #getMinchaGedola()
3105         * @see #getMinchaKetanaAteretTorah()
3106         * @see ZmanimCalendar#getMinchaGedola()
3107         * @see #getAteretTorahSunsetOffset()
3108         * @see #setAteretTorahSunsetOffset(double)
3109         * 
3110         * @return the <code>Date</code> of the time of <em>mincha gedola</em>. If the calculation can't be computed such as
3111         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
3112         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
3113         *         {@link AstronomicalCalendar} documentation.
3114         */
3115        public Date getMinchaGedolaAteretTorah() {
3116                return getMinchaGedola(getAlos72Zmanis(), getTzaisAteretTorah(), false);
3117        }
3118
3119        /**
3120         * This method returns the time of <em>mincha ketana</em> based on the calculation of
3121         * <em>Chacham</em> Yosef Harari-Raful of Yeshivat Ateret Torah, that the day starts
3122         * {@link #getAlos72Zmanis() 1/10th of the day} before sunrise and is usually calculated as ending
3123         * {@link #getTzaisAteretTorah() 40 minutes after sunset} (configurable to any offset via
3124         * {@link #setAteretTorahSunsetOffset(double)}). This is the preferred earliest time to pray <em>mincha</em>
3125         * according to the opinion of the <a href="https://en.wikipedia.org/wiki/Maimonides">Rambam</a> and others.
3126         * For more information on this see the documentation on {@link #getMinchaGedola() <em>mincha gedola</em>}. This is
3127         * calculated as 9.5 {@link #getShaahZmanisAteretTorah() solar hours} after {@link #getAlos72Zmanis() <em>alos</em>}.
3128         * The calculation used is 9.5 * {@link #getShaahZmanisAteretTorah()} after {@link #getAlos72Zmanis() <em>alos</em>}.
3129         * 
3130         * @see #getAlos72Zmanis()
3131         * @see #getTzaisAteretTorah()
3132         * @see #getShaahZmanisAteretTorah()
3133         * @see #getAteretTorahSunsetOffset()
3134         * @see #setAteretTorahSunsetOffset(double)
3135         * @see #getMinchaGedola()
3136         * @see #getMinchaKetana()
3137         * @return the <code>Date</code> of the time of <em>mincha ketana</em>. If the calculation can't be computed such as
3138         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
3139         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
3140         *         {@link AstronomicalCalendar} documentation.
3141         */
3142        public Date getMinchaKetanaAteretTorah() {
3143                return getMinchaKetana(getAlos72Zmanis(), getTzaisAteretTorah(), false);
3144        }
3145
3146        /**
3147         * This method returns the time of <em>plag hamincha</em> based on the calculation of <em>Chacham</em> Yosef Harari-Raful
3148         * of Yeshivat Ateret Torah, that the day starts {@link #getAlos72Zmanis() 1/10th of the day} before sunrise and is
3149         * usually calculated as ending {@link #getTzaisAteretTorah() 40 minutes after sunset} (configurable to any offset
3150         * via {@link #setAteretTorahSunsetOffset(double)}). <em>shaos zmaniyos</em> are calculated based on this day and
3151         * added to {@link #getAlos72Zmanis() <em>alos</em>} to reach this time. This time is 10.75
3152         * {@link #getShaahZmanisAteretTorah() <em>shaos zmaniyos</em>} (temporal hours) after {@link #getAlos72Zmanis()
3153         * dawn}.
3154         * 
3155         * @return the <code>Date</code> of the <em>plag</em>. If the calculation can't be computed such as in the Arctic Circle
3156         *         where there is at least one day a year where the sun does not rise, and one where it does not set, a null
3157         *         will be returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
3158         * @see #getAlos72Zmanis()
3159         * @see #getTzaisAteretTorah()
3160         * @see #getShaahZmanisAteretTorah()
3161         * @see #setAteretTorahSunsetOffset(double)
3162         * @see #getAteretTorahSunsetOffset()
3163         */
3164        public Date getPlagHaminchaAteretTorah() {
3165                return getPlagHamincha(getAlos72Zmanis(), getTzaisAteretTorah(), false);
3166        }
3167
3168        /**
3169         * Method to return <em>tzais</em> (dusk) calculated as 72 minutes zmaniyos, or 1/10th of the day after
3170         * {@link #getSeaLevelSunset() sea level sunset}. This is the way that the <a href=
3171         * "https://en.wikipedia.org/wiki/Abraham_Cohen_Pimentel">Minchas Cohen</a> in Ma'amar 2:4 calculates Rebbeinu Tam's
3172         * time of <em>tzeis</em>. It should be noted that this calculation results in the shortest time from sunset to
3173         * <em>tzais</em> being during the winter solstice, the longest at the summer solstice and 72 clock minutes at the
3174         * equinox. This does not match reality, since there is no direct relationship between the length of the day and
3175         * twilight. The shortest twilight is during the equinox, the longest is during the summer solstice, and in the
3176         * winter with the shortest daylight, the twilight period is longer than during the equinoxes.
3177         * 
3178         * @return the <code>Date</code> representing the time. If the calculation can't be computed such as in the Arctic
3179         *         Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
3180         *         a <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
3181         *         documentation.
3182         * @see #getAlos72Zmanis()
3183         */
3184        public Date getTzais72Zmanis() {
3185                return getZmanisBasedOffset(1.2);
3186        }
3187        
3188        /**
3189         * A utility method to return <em>alos</em> (dawn) or <em>tzais</em> (dusk) based on a fractional day offset.
3190         * @param hours the number of <em>shaos zmaniyos</em> (temporal hours) before sunrise or after sunset that defines dawn
3191         *        or dusk. If a negative number is passed in, it will return the time of <em>alos</em> (dawn) (subtracting the
3192         *        time from sunrise) and if a positive number is passed in, it will return the time of <em>tzais</em> (dusk)
3193         *        (adding the time to sunset). If 0 is passed in, a <code>null</code> will be returned (since we can't tell if it
3194         *        is sunrise or sunset based).
3195         * @return the <code>Date</code> representing the time. If the calculation can't be computed such as in the Arctic
3196         *         Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
3197         *         a <code>null</code> will be returned. A <code>null</code> will also be returned if 0 is passed in, since we can't
3198         *         tell if it is sunrise or sunset based. See detailed explanation on top of the {@link AstronomicalCalendar}
3199         *         documentation.
3200         */
3201        private Date getZmanisBasedOffset(double hours) {
3202                long shaahZmanis = getShaahZmanisGra();
3203                if (shaahZmanis == Long.MIN_VALUE || hours == 0) {
3204                        return null;
3205                }
3206
3207                if (hours > 0) {
3208                        return getTimeOffset(getElevationAdjustedSunset(), (long) (shaahZmanis * hours));
3209                } else {
3210                        return getTimeOffset(getElevationAdjustedSunrise(), (long) (shaahZmanis * hours));
3211                }
3212        }
3213
3214        /**
3215         * Method to return <em>tzais</em> (dusk) calculated using 90 minutes zmaniyos or 1/8th of the day after {@link
3216         * #getSeaLevelSunset() sea level sunset}. This time is known in Yiddish as the <em>achtel</em> (an eighth)
3217         * <em>zman</em>.
3218         * 
3219         * @return the <code>Date</code> representing the time. If the calculation can't be computed such as in the Arctic
3220         *         Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
3221         *         a <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
3222         *         documentation.
3223         * @see #getAlos90Zmanis()
3224         */
3225        public Date getTzais90Zmanis() {
3226                return getZmanisBasedOffset(1.5);
3227        }
3228
3229        /**
3230         * Method to return <em>tzais</em> (dusk) calculated using 96 minutes <em>zmaniyos</em> or 1/7.5 of the day after
3231         * {@link #getSeaLevelSunset() sea level sunset}.
3232         * 
3233         * @return the <code>Date</code> representing the time. If the calculation can't be computed such as in the Arctic
3234         *         Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
3235         *         a <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
3236         *         documentation.
3237         * @see #getAlos96Zmanis()
3238         */
3239        public Date getTzais96Zmanis() {
3240                return getZmanisBasedOffset(1.6);
3241        }
3242
3243        /**
3244         * Method to return <em>tzais</em> (dusk) calculated as 90 minutes after sea level sunset. This method returns
3245         * <em>tzais</em> (nightfall) based on the opinion of the Magen Avraham that the time to walk the distance of a
3246         * <a href="https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a> according to the
3247         * <a href="https://en.wikipedia.org/wiki/Maimonides">Rambam</a>'s opinion is 18 minutes, for a total of 90
3248         * minutes based on the opinion of Ula who calculated <em>tzais</em> as 5 mil after sea level
3249         * <em>shkiah</em> (sunset). A similar calculation {@link #getTzais19Point8Degrees()} uses solar position
3250         * calculations based on this time.
3251         * 
3252         * @return the <code>Date</code> representing the time. If the calculation can't be computed such as in the Arctic
3253         *         Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
3254         *         a <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
3255         *         documentation.
3256         * @see #getTzais19Point8Degrees()
3257         * @see #getAlos90()
3258         */
3259        public Date getTzais90() {
3260                return getTimeOffset(getElevationAdjustedSunset(), 90 * MINUTE_MILLIS);
3261        }
3262
3263        /**
3264         * This method should be used <em>lechumra</em> only and returns <em>tzais</em> (nightfall) based on the calculations
3265         * of <a href="https://en.wikipedia.org/wiki/Avraham_Chaim_Naeh">Rav Chaim Naeh</a> that the time to walk the
3266         * distance of a <a href="https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a>
3267         * according to the <a href="https://en.wikipedia.org/wiki/Maimonides">Rambam</a>'s opinion is 2/5 of an hour (24 minutes)
3268         * for a total of 120 minutes based on the opinion of <em>Ula</em> who calculated <em>tzais</em> as 5 mil after
3269         * sea level <em>shkiah</em> (sunset). A similar calculation {@link #getTzais26Degrees()} uses degree-based calculations
3270         * based on this 120 minute calculation. Since the <em>zman</em> is extremely late and at a point that is long past the
3271         * 18&deg; point where the darkest point is reached, it should only be used <em>lechumra</em>, such as delaying the start
3272         * of nighttime <em>mitzvos</em>.
3273         * 
3274         * @deprecated This method should be used <em>lechumra</em> only since it returns a very late time, and if used
3275         *         <em>lekula</em> can result in <em>chillul Shabbos</em> etc. There is no current plan to remove this
3276         *         method from the API, and this deprecation is intended to alert developers of the danger of using it.
3277         * 
3278         * @return the <code>Date</code> representing the time. If the calculation can't be computed such as in the Arctic
3279         *         Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
3280         *         a <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}.
3281         *         documentation.
3282         * @see #getTzais26Degrees()
3283         * @see #getAlos120()
3284         */
3285        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
3286        public Date getTzais120() {
3287                return getTimeOffset(getElevationAdjustedSunset(), 120 * MINUTE_MILLIS);
3288        }
3289
3290        /**
3291         * This method should be used <em>lechumra</em> only and returns <em>tzais</em> (dusk) calculated using 120 minutes
3292         * <em>zmaniyos</em> after {@link #getSeaLevelSunset() sea level sunset}. Since the <em>zman</em>
3293         * is extremely late and at a time when the sun is well below the 18&deg; point (scientifically the darkest point) in
3294         * most places on the globe, it should only be used <em>lechumra</em>, such as delaying the start of nighttime
3295         * <em>mitzvos</em>.
3296         * 
3297         * @deprecated This method should be used <em>lechumra</em> only since it returns a very late time, and if used
3298         *         <em>lekula</em> can result in <em>chillul Shabbos</em> etc. There is no current plan to remove this
3299         *         method from the API, and this deprecation is intended to alert developers of the danger of using it.
3300         * 
3301         * @return the <code>Date</code> representing the time. If the calculation can't be computed such as in the Arctic
3302         *         Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
3303         *         a <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
3304         *         documentation.
3305         * @see #getAlos120Zmanis()
3306         * @see #getTzais120()
3307         * @see #getTzais26Degrees()
3308         */
3309        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
3310        public Date getTzais120Zmanis() {
3311                return getZmanisBasedOffset(2.0);
3312        }
3313
3314        /**
3315         * This calculates the time of <em>tzais</em> at the point when the sun is 16.1&deg; below the horizon. This is
3316         * the sun's dip below the horizon 72 minutes after sunset according Rabbeinu Tam's calculation of <em>tzais</em>
3317         * <a href=
3318         * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a> in
3319         * Jerusalem. The question of equinox VS equilux is complex, with Rabbi Meir Posen in the <a href=
3320         * "https://www.worldcat.org/oclc/956316270">Ohr Meir</a> of the opinion that the equilux should be used. See
3321         * Yisrael Vehazmanim vol I, 34:1:4. Rabbi Yedidya Manet in his <a href=
3322         * "https://www.nli.org.il/en/books/NNL_ALEPH002542826/NLI">Zmanei Halacha Lema'aseh</a> (4th edition part 2, pages
3323         * and 22 and 24) and Rabbi Yonah Mertzbuch (in a letter published by Rabbi Manet) are of the opinion that the
3324         * astronomical equinox should be used. The difference adds up to about 9 seconds, too trivial to make much of a
3325         * difference. For information on how this is calculated see the comments on {@link #getAlos16Point1Degrees()}.
3326         * 
3327         * @return the <code>Date</code> representing the time. If the calculation can't be computed such as northern and
3328         *         southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may
3329         *         not reach low enough below the horizon for this calculation, a <code>null</code> will be returned. See
3330         *         detailed explanation on top of the {@link AstronomicalCalendar} documentation.
3331         * @see #getTzais72()
3332         * @see #getAlos16Point1Degrees() for more information on this calculation.
3333         */
3334        public Date getTzais16Point1Degrees() {
3335                return getSunsetOffsetByDegrees(ZENITH_16_POINT_1);
3336        }
3337
3338        /**
3339         * This method should be used <em>lechumra</em> only and returns <em>tzais</em> based on when the sun is 26&deg;
3340         * below the horizon. For information on how this is calculated see the comments on {@link #getAlos26Degrees()}.
3341         * Since the <em>zman</em> is extremely late and at a point when it is long past the 18&deg; point where the
3342         * darkest point is reached, it should only be used <em>lechumra</em> such as delaying the start of nighttime
3343         * <em>mitzvos</em>.
3344         * 
3345         * @deprecated This method should be used <em>lechumra</em> only since it returns a very late time, and if used
3346         *         <em>lekula</em> can result in <em>chillul Shabbos</em> etc. There is no current plan to remove this
3347         *         method from the API, and this deprecation is intended to alert developers of the danger of using it.
3348         * 
3349         * @return the <code>Date</code> representing the time. If the calculation can't be computed such as northern and
3350         *         southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may
3351         *         not reach low enough below the horizon for this calculation, a <code>null</code> will be returned. See
3352         *         detailed explanation on top of the {@link AstronomicalCalendar} documentation.
3353         * @see #getTzais120()
3354         * @see #getAlos26Degrees()
3355         */
3356        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
3357        public Date getTzais26Degrees() {
3358                return getSunsetOffsetByDegrees(ZENITH_26_DEGREES);
3359        }
3360
3361        /**
3362         * For information on how this is calculated see the comments on {@link #getAlos18Degrees()}
3363         * 
3364         * @return the <code>Date</code> representing the time. If the calculation can't be computed such as northern and
3365         *         southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may
3366         *         not reach low enough below the horizon for this calculation, a <code>null</code> will be returned. See
3367         *         detailed explanation on top of the {@link AstronomicalCalendar} documentation.
3368         * @see #getAlos18Degrees()
3369         */
3370        public Date getTzais18Degrees() {
3371                return getSunsetOffsetByDegrees(ASTRONOMICAL_ZENITH);
3372        }
3373
3374        /**
3375         * For information on how this is calculated see the comments on {@link #getAlos19Point8Degrees()}
3376         * 
3377         * @return the <code>Date</code> representing the time. If the calculation can't be computed such as northern and
3378         *         southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may
3379         *         not reach low enough below the horizon for this calculation, a <code>null</code> will be returned. See
3380         *         detailed explanation on top of the {@link AstronomicalCalendar} documentation.
3381         * @see #getTzais90()
3382         * @see #getAlos19Point8Degrees()
3383         */
3384        public Date getTzais19Point8Degrees() {
3385                return getSunsetOffsetByDegrees(ZENITH_19_POINT_8);
3386        }
3387
3388        /**
3389         * A method to return <em>tzais</em> (dusk) calculated as 96 minutes after sea level sunset. For information on how
3390         * this is calculated see the comments on {@link #getAlos96()}.
3391         * 
3392         * @return the <code>Date</code> representing the time. If the calculation can't be computed such as in the Arctic
3393         *         Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
3394         *         a <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
3395         *         documentation.
3396         * @see #getAlos96()
3397         */
3398        public Date getTzais96() {
3399                return getTimeOffset(getElevationAdjustedSunset(), 96 * MINUTE_MILLIS);
3400        }
3401
3402        /**
3403         * A method that returns the local time for fixed <em>chatzos</em>. This time is noon and midnight adjusted from
3404         * standard time to account for the local latitude. The 360&deg; of the globe divided by 24 calculates to 15&deg;
3405         * per hour with 4 minutes per degree, so at a longitude of 0 , 15, 30 etc... <em>Chatzos</em> is at exactly 12:00
3406         * noon. This is the time of <em>chatzos</em> according to the <a href=
3407         * "https://en.wikipedia.org/wiki/Aruch_HaShulchan">Aruch Hashulchan</a> in <a href=
3408         * "https://hebrewbooks.org/pdfpager.aspx?req=7705&pgnum=426">Orach Chaim 233:14</a> and <a href=
3409         * "https://en.wikipedia.org/wiki/Moshe_Feinstein">Rabbi Moshe Feinstein</a> in Igros Moshe <a href=
3410         * "https://hebrewbooks.org/pdfpager.aspx?req=916&st=&pgnum=67">Orach Chaim 1:24</a> and <a href=
3411         * "https://hebrewbooks.org/pdfpager.aspx?req=14675&pgnum=191">2:20</a>.
3412         * Lakewood, N.J., with a longitude of -74.222, is 0.778 away from the closest multiple of 15 at -75&deg;. This
3413         * 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
3414         * to the theoretical 15&deg; time zones, but will adjust to the actual time zone and <a
3415         * href="https://en.wikipedia.org/wiki/Daylight_saving_time">Daylight saving time</a>.
3416         * 
3417         * @return the Date representing the local <em>chatzos</em>
3418         * @see GeoLocation#getLocalMeanTimeOffset()
3419         * @see AstronomicalCalendar#getLocalMeanTime(double)
3420         */
3421        public Date getFixedLocalChatzos() {
3422                return getLocalMeanTime(12.0);
3423        }
3424
3425        /**
3426         * A method that returns the latest <em>zman krias shema</em> (time to recite Shema in the morning) calculated as 3
3427         * clock hours before {@link #getFixedLocalChatzos()}. Note that there are opinions brought down in Yisrael Vehazmanim
3428         * <a href="https://hebrewbooks.org/pdfpager.aspx?req=9765&st=&pgnum=85">page 57</a> and Rav Yitzchak Silber's <a href=
3429         * "https://www.worldcat.org/oclc/811253716">Shaos Shavos Bahalacha</a> that this calculation is a mistake and regular
3430         * <em>chatzos</em> should be used for clock-hour calculations as opposed to fixed local <em>chatzos</em>. According to
3431         * these opinions it should be 3 clock hours before regular <em>chatzos</em> as calculated in {@link
3432         * #getSofZmanShma3HoursBeforeChatzos()}.
3433         * 
3434         * @return the <code>Date</code> of the latest <em>zman krias shema</em> calculated as 3 clock hours before
3435         *         {@link #getFixedLocalChatzos()}.
3436         * @see #getFixedLocalChatzos()
3437         * @see #getSofZmanShma3HoursBeforeChatzos()
3438         * @see #getSofZmanTfilaFixedLocal()
3439         *         
3440         * @deprecated This method of calculating <em>sof zman Shma</em> is considered a mistaken understanding of the proper
3441         *         calculation of this <em>zman</em> in the opinion of Rav Yitzchak Silber's <a href=
3442         *         "https://www.worldcat.org/oclc/811253716">Sha'aos Shavos Bahalacha</a>. On pages 316-318 he discusses Rav Yisrael
3443         *         Harfenes's calculations and points to his seeming agreement that using fixed local <em>chatzos</em> as the focal
3444         *         point is problematic. See Yisrael Vehazmanim <a href=
3445         *         "https://hebrewbooks.org/pdfpager.aspx?req=9765&st=&pgnum=85">page 57</a>. While the Yisrael Vehazmanim mentions
3446         *         this issue in vol. 1, it was not corrected in the calculations in vol. 3 and other parts of the <em>sefer</em>.
3447         *         A competent rabbinical authority should be consulted before using this <em>zman</em>. Instead, the use of {@link
3448         *         #getSofZmanShma3HoursBeforeChatzos()} should be used to calculate <em>sof zman Tfila</em> using 3 fixed clock hours.
3449         *         This will likely be removed in v3.0.
3450         */
3451        @Deprecated // (since="2.4.0", forRemoval=true) // add back once Java 9 is the minimum supported version
3452        public Date getSofZmanShmaFixedLocal() {
3453                return getTimeOffset(getFixedLocalChatzos(), -180 * MINUTE_MILLIS);
3454        }
3455
3456        /**
3457         * This method returns the latest <em>zman tfila</em> (time to recite the morning prayers) calculated as 2 hours
3458         * before {@link #getFixedLocalChatzos()}. See the documentation on {@link #getSofZmanShmaFixedLocal()} showing
3459         * differing opinions on how the <em>zman</em> is calculated. According to many opinions {@link
3460         * #getSofZmanTfila2HoursBeforeChatzos()} should be used as opposed to this <em>zman</em>.
3461         * 
3462         * @return the <code>Date</code> of the latest <em>zman tfila</em>.
3463         * @see #getFixedLocalChatzos()
3464         * @see #getSofZmanShmaFixedLocal()
3465         * @see #getSofZmanTfila2HoursBeforeChatzos()
3466         *         
3467         * @deprecated This method of calculating <em>sof zman Tfila</em> is considered a mistaken understanding of the proper
3468         *         calculation of this <em>zman</em> in the opinion of Rav Yitzchak Silber's <a href=
3469         *         "https://www.worldcat.org/oclc/811253716">Sha'aos Shavos Bahalacha</a>. On pages 316-318 he discusses Rav Yisrael
3470         *         Harfenes's calculations and points to his seeming agreement that using fixed local <em>chatzos</em> as the focal
3471         *         point is problematic. See Yisrael Vehazmanim <a href=
3472         *         "https://hebrewbooks.org/pdfpager.aspx?req=9765&st=&pgnum=85">page 57</a>. While the Yisrael Vehazmanim mentions
3473         *         this issue in vol. 1, it was not corrected in the calculations in vol. 3 and other parts of the <em>sefer</em>.
3474         *         A competent rabbinical authority should be consulted before using this <em>zman</em>. Instead, the use of {@link
3475         *         #getSofZmanTfila2HoursBeforeChatzos()} should be used to calculate <em>sof zman Tfila</em> using 2 fixed
3476         *         clock hours. This will likely be removed in v3.0.
3477         */
3478        @Deprecated // (since="2.4.0", forRemoval=true) // add back once Java 9 is the minimum supported version
3479        public Date getSofZmanTfilaFixedLocal() {
3480                return getTimeOffset(getFixedLocalChatzos(), -120 * MINUTE_MILLIS);
3481        }
3482
3483        /**
3484         * Returns the latest time of <em>Kidush Levana</em> according to the <a
3485         * href="https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin">Maharil's</a> opinion that it is calculated as
3486         * halfway between <em>molad</em> and <em>molad</em>. This adds half the 29 days, 12 hours and 793 chalakim time
3487         * between <em>molad</em> and <em>molad</em> (14 days, 18 hours, 22 minutes and 666 milliseconds) to the month's <em>molad</em>.
3488         * 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
3489         * 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
3490         * this method, the non-daytime adjusted time will be returned.
3491         * 
3492         * @param alos
3493         *            the beginning of the Jewish day. If <em>Kidush Levana</em> occurs during the day (starting at <em>alos</em> and
3494         *            ending at <em>tzais</em>), the time returned will be <em>alos</em>. If either the <em>alos</em> or <em>tzais</em>
3495         *            parameters are null, no daytime adjustment will be made.
3496         * @param tzais
3497         *            the end of the Jewish day. If Kidush Levana occurs during the day (starting at <em>alos</em> and ending at
3498         *            <em>tzais</em>), the time returned will be <em>alos</em>. If either the <em>alos</em> or <em>tzais</em> parameter
3499         *            are null, no daytime adjustment will be made.
3500         * @return the Date representing the moment halfway between molad and molad. If the time occurs between
3501         *         <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
3502         *         <code>null</code> will be returned.
3503         * @see #getSofZmanKidushLevanaBetweenMoldos()
3504         * @see #getSofZmanKidushLevana15Days(Date, Date)
3505         * @see JewishCalendar#getSofZmanKidushLevanaBetweenMoldos()
3506         */
3507        public Date getSofZmanKidushLevanaBetweenMoldos(Date alos, Date tzais) {
3508                JewishCalendar jewishCalendar = new JewishCalendar();
3509                jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
3510                                getCalendar().get(Calendar.DAY_OF_MONTH));
3511
3512                // Do not calculate for impossible dates, but account for extreme cases. In the extreme case of Rapa Iti in French
3513                // Polynesia on Dec 2027 when kiddush Levana 3 days can be said on <em>Rosh Chodesh</em>, the sof zman Kiddush Levana
3514                // will be on the 12th of the Teves. In the case of Anadyr, Russia on Jan, 2071, sof zman Kiddush Levana between the
3515                // moldos will occur is on the night of 17th of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).
3516                if (jewishCalendar.getJewishDayOfMonth() < 11 || jewishCalendar.getJewishDayOfMonth() > 16) { 
3517                        return null;
3518                }
3519                return getMoladBasedTime(jewishCalendar.getSofZmanKidushLevanaBetweenMoldos(), alos, tzais, false);
3520        }
3521        
3522        /**
3523         * Returns the Date of the <em>molad</em> based time if it occurs on the current date. Since <em>Kiddush Levana</em>
3524         * can only be said during the day, there are parameters to limit it to between <em>alos</em> and <em>tzais</em>. If
3525         * the time occurs between <em>alos</em> and <em>tzais</em>, <em>tzais</em> will be returned.
3526         * 
3527         * @param moladBasedTime
3528         *            the <em>molad</em> based time such as <em>molad</em>, <em>tchilas</em> and <em>sof zman Kiddush Levana</em>
3529         * @param alos
3530         *            optional start of day to limit <em>molad</em> times to the end of the night before or beginning of the next night.
3531         *            Ignored if either <em>alos</em> or <em>tzais</em> are null.
3532         * @param tzais
3533         *            optional end of day to limit <em>molad</em> times to the end of the night before or beginning of the next night.
3534         *            Ignored if either <em>tzais</em> or <em>alos</em> are null
3535         * @param techila
3536         *            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>,
3537         *            and if it is the end, return the end of the previous night (<em>alos</em> passed in). Ignored if either
3538         *            <em>alos</em> or <em>tzais</em> are null.
3539         * @return the <em>molad</em> based time. If the <em>zman</em> does not occur during the current date, <code>null</code> will be
3540         *         returned.
3541         */
3542        private Date getMoladBasedTime(Date moladBasedTime, Date alos, Date tzais, boolean techila) {
3543                Date lastMidnight = getMidnightLastNight();
3544            Date midnightTonight = getMidnightTonight();
3545                if(moladBasedTime.before(lastMidnight) || moladBasedTime.after(midnightTonight)){ // Invalid time, bailout
3546                        return null;
3547                } else if (alos == null || tzais == null){ // Not enough info to adjust
3548                   return moladBasedTime;
3549                } else { // It's the daytime, get the next/prev night
3550                        if (moladBasedTime.after(alos) && moladBasedTime.before(tzais)) {
3551                                if (techila) {
3552                                        return tzais;
3553                                } else {
3554                                        return alos;
3555                                }
3556                        } else { // It's the night, the provided time is valid
3557                                return moladBasedTime;
3558                        }
3559                }
3560        }
3561
3562        /**
3563         * Returns the latest time of Kiddush Levana according to the <a
3564         * href="https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin">Maharil's</a> opinion that it is calculated as
3565         * halfway between <em>molad</em> and <em>molad</em>. This adds half the 29 days, 12 hours and 793 chalakim time between
3566         * <em>molad</em> and <em>molad</em> (14 days, 18 hours, 22 minutes and 666 milliseconds) to the month's <em>molad</em>.
3567         * The <em>sof zman Kiddush Levana</em> will be returned even if it occurs during the day. To limit the time to between
3568         * <em>tzais</em> and <em>alos</em>, see {@link #getSofZmanKidushLevanaBetweenMoldos(Date, Date)}.
3569         * 
3570         * @return the Date representing the moment halfway between molad and molad. If the time occurs between
3571         *         <em>alos</em> and <em>tzais</em>, <em>alos</em> will be returned. If the <em>zman</em> will not occur on this
3572         *         day, a <code>null</code> will be returned.
3573         * @see #getSofZmanKidushLevanaBetweenMoldos(Date, Date)
3574         * @see #getSofZmanKidushLevana15Days()
3575         * @see JewishCalendar#getSofZmanKidushLevanaBetweenMoldos()
3576         */
3577        public Date getSofZmanKidushLevanaBetweenMoldos() {
3578                return getSofZmanKidushLevanaBetweenMoldos(null, null); 
3579        }
3580
3581        /**
3582         * Returns the latest time of <em>Kiddush Levana</em> calculated as 15 days after the <em>molad</em>. This is the
3583         * opinion brought down in the Shulchan Aruch (Orach Chaim 426). It should be noted that some opinions hold that the
3584         * <a href="https://en.wikipedia.org/wiki/Moses_Isserles">Rema</a> who brings down the opinion of the <a
3585         * href="https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin">Maharil's</a> of calculating
3586         * {@link #getSofZmanKidushLevanaBetweenMoldos(Date, Date) half way between <em>molad</em> and <em>molad</em>} is of
3587         * the opinion that the Mechaber agrees to his opinion. Also see the Aruch Hashulchan. For additional details on the subject,
3588         * see Rabbi Dovid Heber's very detailed write-up in <em>Siman Daled</em> (chapter 4) of <a href=
3589         * "https://hebrewbooks.org/53000">Shaarei Zmanim</a>. If the time of <em>sof zman Kiddush Levana</em> occurs during
3590         * 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
3591         * null <em>alos</em> or <em>tzais</em> are passed to this method, the non-daytime adjusted time will be returned.
3592         * 
3593         * @param alos
3594         *            the beginning of the Jewish day. If <em>Kidush Levana</em> occurs during the day (starting at <em>alos</em> and
3595         *            ending at <em>tzais</em>), the time returned will be <em>alos</em>. If either the <em>alos</em> or <em>tzais</em>
3596         *            parameters are null, no daytime adjustment will be made.
3597         * @param tzais
3598         *            the end of the Jewish day. If <em>Kidush Levana</em> occurs during the day (starting at <em>alos</em> and ending at
3599         *            <em>tzais</em>), the time returned will be <em>alos</em>. If either the <em>alos</em> or <em>tzais</em> parameters
3600         *            are null, no daytime adjustment will be made.
3601         *
3602         * @return the Date representing the moment 15 days after the molad. If the time occurs between <em>alos</em> and
3603         *         <em>tzais</em>, <em>alos</em> will be returned. If the <em>zman</em> will not occur on this day, a
3604         *         <code>null</code> will be returned.
3605         * 
3606         * @see #getSofZmanKidushLevanaBetweenMoldos(Date, Date)
3607         * @see JewishCalendar#getSofZmanKidushLevana15Days()
3608         */
3609        public Date getSofZmanKidushLevana15Days(Date alos, Date tzais) {
3610                JewishCalendar jewishCalendar = new JewishCalendar();
3611                jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
3612                                getCalendar().get(Calendar.DAY_OF_MONTH));
3613                // Do not calculate for impossible dates, but account for extreme cases. In the extreme case of Rapa Iti in
3614                // French Polynesia on Dec 2027 when kiddush Levana 3 days can be said on <em>Rosh Chodesh</em>, the sof zman Kiddush
3615                // Levana will be on the 12th of the Teves. in the case of Anadyr, Russia on Jan, 2071, sof zman kiddush levana will
3616                // occur after midnight on the 17th of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).
3617                if (jewishCalendar.getJewishDayOfMonth() < 11 || jewishCalendar.getJewishDayOfMonth() > 17) {
3618                        return null;
3619                }
3620                return getMoladBasedTime(jewishCalendar.getSofZmanKidushLevana15Days(), alos, tzais, false);
3621        }
3622
3623        /**
3624         * Returns the latest time of <em>Kiddush Levana</em> calculated as 15 days after the molad. This is the opinion of
3625         * the Shulchan Aruch (Orach Chaim 426). It should be noted that some opinions hold that the
3626         * <a href="https://en.wikipedia.org/wiki/Moses_Isserles">Rema</a> who brings down the opinion of the <a
3627         * href="https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin">Maharil's</a> of calculating
3628         * {@link #getSofZmanKidushLevanaBetweenMoldos(Date, Date) half way between <em>molad</em> and <em>molad</em>} is of
3629         * the opinion that the Mechaber agrees to his opinion. Also see the Aruch Hashulchan. For additional details on the subject,
3630         * See Rabbi Dovid Heber's very detailed write-up in Siman Daled (chapter 4) of <a href="https://hebrewbooks.org/53000">Shaarei
3631         * Zmanim</a>. The <em>sof zman Kiddush Levana</em> will be returned even if it occurs during the day. To limit the time to
3632         * between <em>tzais</em> and <em>alos</em>, see {@link #getSofZmanKidushLevana15Days(Date, Date)}.
3633         * 
3634         * @return the Date representing the moment 15 days after the <em>molad</em>. If the time occurs between
3635         *         <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
3636         *         <code>null</code> will be returned.
3637         * 
3638         * @see #getSofZmanKidushLevana15Days(Date, Date)
3639         * @see #getSofZmanKidushLevanaBetweenMoldos()
3640         * @see JewishCalendar#getSofZmanKidushLevana15Days()
3641         * 
3642         */
3643        public Date getSofZmanKidushLevana15Days() {
3644                return getSofZmanKidushLevana15Days(null, null);
3645        }
3646        
3647        /**
3648         * Returns the earliest time of <em>Kiddush Levana</em> according to <a href=
3649         * "https://en.wikipedia.org/wiki/Yonah_Gerondi">Rabbeinu Yonah</a>'s opinion that it can be said 3 days after the
3650         * <em>molad</em>. The time will be returned even if it occurs during the day when <em>Kiddush Levana</em> can't be said.
3651         * Use {@link #getTchilasZmanKidushLevana3Days(Date, Date)} if you want to limit the time to night hours.
3652         * 
3653         * @return the Date representing the moment 3 days after the molad. If the <em>zman</em> will not occur on this day, a
3654         *         <code>null</code> will be returned.
3655         * @see #getTchilasZmanKidushLevana3Days(Date, Date)
3656         * @see #getTchilasZmanKidushLevana7Days()
3657         * @see JewishCalendar#getTchilasZmanKidushLevana3Days()
3658         */
3659        public Date getTchilasZmanKidushLevana3Days() {
3660                return getTchilasZmanKidushLevana3Days(null, null);
3661        }
3662
3663        /**
3664         * Returns the earliest time of <em>Kiddush Levana</em> according to <a href=
3665         * "https://en.wikipedia.org/wiki/Yonah_Gerondi">Rabbeinu Yonah</a>'s opinion that it can be said 3 days after the <em>molad</em>.
3666         * If the time of <em>tchilas zman Kiddush Levana</em> occurs during the day (between <em>alos</em> and <em>tzais</em> passed to
3667         * 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
3668         * <em>tchilas zman Kiddush Levana</em> will be returned, regardless of if it is during the day or not.
3669         * 
3670         * @param alos
3671         *            the beginning of the Jewish day. If Kidush Levana occurs during the day (starting at <em>alos</em> and ending
3672         *            at <em>tzais</em>), the time returned will be <em>tzais</em>. If either the <em>alos</em> or <em>tzais</em> parameters
3673         *            are null, no daytime adjustment will be made.
3674         * @param tzais
3675         *            the end of the Jewish day. If <em>Kidush Levana</em> occurs during the day (starting at <em>alos</em> and ending at
3676         *            <em>tzais</em>), the time returned will be <em>tzais</em>. If either the <em>alos</em> or <em>tzais</em> parameters
3677         *            are null, no daytime adjustment will be made.
3678         *
3679         * @return the Date representing the moment 3 days after the molad. If the time occurs between <em>alos</em> and
3680         *         <em>tzais</em>, <em>tzais</em> will be returned. If the <em>zman</em> will not occur on this day, a
3681         *         <code>null</code> will be returned.
3682         * @see #getTchilasZmanKidushLevana3Days()
3683         * @see #getTchilasZmanKidushLevana7Days(Date, Date)
3684         * @see JewishCalendar#getTchilasZmanKidushLevana3Days()
3685         */
3686        public Date getTchilasZmanKidushLevana3Days(Date alos, Date tzais) {
3687                JewishCalendar jewishCalendar = new JewishCalendar();
3688                jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
3689                                getCalendar().get(Calendar.DAY_OF_MONTH));
3690                
3691                // Do not calculate for impossible dates, but account for extreme cases. Tchilas zman kiddush Levana 3 days for
3692                // the extreme case of Rapa Iti in French Polynesia on Dec 2027 when kiddush Levana 3 days can be said on the evening
3693                // 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.
3694                // In the case of Anadyr, Russia on Jan, 2071, when sof zman kiddush levana is on the 17th of the month, the 3rd day
3695                // from the molad will be on the 5th day of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).
3696                if (jewishCalendar.getJewishDayOfMonth() > 5 && jewishCalendar.getJewishDayOfMonth() < 30) {
3697                        return null;
3698                }
3699                
3700                Date zman = getMoladBasedTime(jewishCalendar.getTchilasZmanKidushLevana3Days(), alos, tzais, true);
3701                
3702                //Get the following month's zman kiddush Levana for the extreme case of Rapa Iti in French Polynesia on Dec 2027 when
3703                // kiddush Levana can be said on Rosh Chodesh (the evening of the 30th). See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (page 32)
3704                if (zman == null && jewishCalendar.getJewishDayOfMonth() == 30) {
3705                        jewishCalendar.forward(Calendar.MONTH, 1);
3706                        zman = getMoladBasedTime(jewishCalendar.getTchilasZmanKidushLevana3Days(), null, null, true);
3707                }
3708                
3709                return zman;
3710        }
3711        
3712        /**
3713         * Returns the point in time of <em>Molad</em> as a <code>Date</code> Object. For the traditional day of week, hour,
3714         * minute and chalakim, {@link JewishCalendar#getMoladAsDate()} and the not yet completed
3715         * {@link com.kosherjava.zmanim.hebrewcalendar.HebrewDateFormatter} that will have formatting for this.
3716         * 
3717         * @return the Date representing the moment of the molad. If the <em>molad</em> does not occur on this day, a
3718         *         <code>null</code> will be returned.
3719         * 
3720         * @see #getTchilasZmanKidushLevana3Days()
3721         * @see #getTchilasZmanKidushLevana7Days(Date, Date)
3722         * @see JewishCalendar#getMoladAsDate()
3723         */
3724        public Date getZmanMolad() {
3725                JewishCalendar jewishCalendar = new JewishCalendar();
3726                jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
3727                                getCalendar().get(Calendar.DAY_OF_MONTH));
3728                
3729                // Optimize to not calculate for impossible dates, but account for extreme cases. The molad in the extreme case of Rapa
3730                // Iti in French Polynesia on Dec 2027 occurs on the night of the 27th of Kislev. In the case of Anadyr, Russia on
3731                // 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).
3732                if (jewishCalendar.getJewishDayOfMonth() > 2 && jewishCalendar.getJewishDayOfMonth() < 27) {
3733                        return null;
3734                }
3735                Date molad = getMoladBasedTime(jewishCalendar.getMoladAsDate(), null, null, true);
3736
3737                // deal with molad that happens on the end of the previous month
3738                if (molad == null && jewishCalendar.getJewishDayOfMonth() > 26) {
3739                        jewishCalendar.forward(Calendar.MONTH, 1);
3740                        molad = getMoladBasedTime(jewishCalendar.getMoladAsDate(), null, null, true);
3741                }
3742                return molad;
3743        }
3744        
3745        /**
3746         * Used by Molad based <em>zmanim</em> to determine if <em>zmanim</em> occur during the current day.
3747         * @see #getMoladBasedTime(Date, Date, Date, boolean)
3748         * @return previous midnight
3749         */
3750        private Date getMidnightLastNight() {
3751                Calendar midnight = (Calendar)getCalendar().clone();
3752                // reset hour, minutes, seconds and millis
3753                midnight.set(Calendar.HOUR_OF_DAY, 0);
3754                midnight.set(Calendar.MINUTE, 0);
3755                midnight.set(Calendar.SECOND, 0);
3756                midnight.set(Calendar.MILLISECOND, 0);
3757                return midnight.getTime();
3758        }
3759        
3760        /**
3761         * Used by Molad based <em>zmanim</em> to determine if <em>zmanim</em> occur during the current day.
3762         * @see #getMoladBasedTime(Date, Date, Date, boolean)
3763         * @return following midnight
3764         */
3765        private Date getMidnightTonight() {
3766                Calendar midnight = (Calendar)getCalendar().clone();
3767                midnight.add(Calendar.DAY_OF_YEAR, 1);//roll to tonight
3768                midnight.set(Calendar.HOUR_OF_DAY, 0);
3769                midnight.set(Calendar.MINUTE, 0);
3770                midnight.set(Calendar.SECOND, 0);
3771                midnight.set(Calendar.MILLISECOND, 0);
3772                return midnight.getTime();
3773        }
3774
3775        /**
3776         * Returns the earliest time of <em>Kiddush Levana</em> according to the opinions that it should not be said until 7
3777         * days after the <em>molad</em>. If the time of <em>tchilas zman Kiddush Levana</em> occurs during the day (between
3778         * {@link ZmanimCalendar#getAlos72() <em>alos</em>} and {@link ZmanimCalendar#getTzais72() <em>tzais</em>}) it
3779         * return the next <em>tzais</em>.
3780         * 
3781         * @param alos
3782         *            the beginning of the Jewish day. If <em>Kidush Levana</em> occurs during the day (starting at <em>alos</em>
3783         *            and ending at <em>tzais</em>), the time returned will be <em>tzais</em>. If either the <em>alos</em> or
3784         *            <em>tzais</em> parameters are null, no daytime adjustment will be made.
3785         * @param tzais
3786         *            the end of the Jewish day. If <em>Kidush Levana</em> occurs during the day (starting at <em>alos</em> and
3787         *            ending at <em>tzais</em>), the time returned will be <em>tzais</em>. If either the <em>alos</em> or
3788         *            <em>tzais</em> parameters are null, no daytime adjustment will be made.
3789         *
3790         * @return the Date representing the moment 7 days after the molad. If the time occurs between <em>alos</em> and
3791         *         <em>tzais</em>, <em>tzais</em> will be returned. If the <em>zman</em> will not occur on this day, a
3792         *         <code>null</code> will be returned.
3793         * @see #getTchilasZmanKidushLevana3Days(Date, Date)
3794         * @see #getTchilasZmanKidushLevana7Days()
3795         * @see JewishCalendar#getTchilasZmanKidushLevana7Days()
3796         */
3797        public Date getTchilasZmanKidushLevana7Days(Date alos, Date tzais) {
3798                JewishCalendar jewishCalendar = new JewishCalendar();
3799                jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
3800                                getCalendar().get(Calendar.DAY_OF_MONTH));
3801                
3802                // Optimize to not calculate for impossible dates, but account for extreme cases. Tchilas zman kiddush Levana 7 days for
3803                // the extreme case of Rapa Iti in French Polynesia on Jan 2028 (when kiddush Levana 3 days can be said on the evening
3804                // of the 30th, the second night of Rosh Chodesh), the 7th day after the molad will be on the 4th of the month.
3805                // In the case of Anadyr, Russia on Jan, 2071, when sof zman kiddush levana is on the 17th of the month, the 7th day
3806                // from the molad will be on the 9th day of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).
3807                if (jewishCalendar.getJewishDayOfMonth() < 4 || jewishCalendar.getJewishDayOfMonth() > 9) { 
3808                        return null;
3809                }
3810                
3811                return getMoladBasedTime(jewishCalendar.getTchilasZmanKidushLevana7Days(), alos, tzais, true);
3812        }
3813
3814        /**
3815         * Returns the earliest time of <em>Kiddush Levana</em> according to the opinions that it should not be said until 7
3816         * days after the <em>molad</em>. The time will be returned even if it occurs during the day when <em>Kiddush Levana</em>
3817         * can't be recited. Use {@link #getTchilasZmanKidushLevana7Days(Date, Date)} if you want to limit the time to night hours.
3818         * 
3819         * @return the Date representing the moment 7 days after the molad regardless of it is day or night. If the <em>zman</em>
3820         *         will not occur on this day, a <code>null</code> will be returned.
3821         * @see #getTchilasZmanKidushLevana7Days(Date, Date)
3822         * @see JewishCalendar#getTchilasZmanKidushLevana7Days()
3823         * @see #getTchilasZmanKidushLevana3Days()
3824         */
3825        public Date getTchilasZmanKidushLevana7Days() {
3826                return getTchilasZmanKidushLevana7Days(null, null);
3827        }
3828
3829        /**
3830         * This method returns the latest time one is allowed eating <em>chametz</em> on <em>Erev Pesach</em> according to
3831         * the opinion of the <a href="https://en.wikipedia.org/wiki/Vilna_Gaon">GRA</a>. This time is identical to the {@link
3832         * #getSofZmanTfilaGRA() <em>Sof zman tfilah</em> GRA} and is provided as a convenience method for those who are
3833         * unaware how this <em>zman</em> is calculated. This time is 4 hours into the day based on the opinion of the
3834         * <a href="https://en.wikipedia.org/wiki/Vilna_Gaon">GRA</a> that the day is calculated from sunrise to sunset.
3835         * This returns the time 4 * {@link #getShaahZmanisGra()} after {@link #getSeaLevelSunrise() sea level sunrise}. If it
3836         * is not <em>erev Pesach</em>, a null will be returned.
3837         * 
3838         * @see ZmanimCalendar#getShaahZmanisGra()
3839         * @see ZmanimCalendar#getSofZmanTfilaGRA()
3840         * @return the <code>Date</code> one is allowed eating <em>chametz</em> on <em>Erev Pesach</em>. If it is not <em>erev
3841         *         Pesach</em> or the calculation can't be computed such as in the Arctic Circle where there is at least one
3842         *         day a year where the sun does not rise, and one where it does not set, a <code>null</code> will be returned.
3843         *         See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
3844         * @todo in v 3.0.0 enable the calendar check for erev pesach and return <code>null</code> in all other cases.
3845         */
3846        public Date getSofZmanAchilasChametzGRA() {
3847                /*JewishCalendar jewishCalendar = new JewishCalendar();
3848                jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
3849                                getCalendar().get(Calendar.DAY_OF_MONTH));
3850                if (jewishCalendar.getJewishMonth() == JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() == 14) { 
3851                        return getSofZmanTfilaGRA();
3852                } else {
3853                        return null;
3854                }*/
3855                return getSofZmanTfilaGRA();
3856        }
3857
3858        /**
3859         * This method returns the latest time one is allowed eating <em>chametz</em> on <em>Erev Pesach</em> according to the
3860         * opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on <em>alos</em>
3861         * being {@link #getAlos72() 72} minutes before {@link #getSunrise() sunrise}. This time is identical to the
3862         * {@link #getSofZmanTfilaMGA72Minutes() <em>Sof zman tfilah</em> MGA 72 minutes}. This time is 4 {@link #getShaahZmanisMGA()
3863         * <em>shaos zmaniyos</em>} (temporal hours) after {@link #getAlos72() dawn} based on the opinion of the MGA that the day is
3864         * calculated from a {@link #getAlos72() dawn} of 72 minutes before sunrise to {@link #getTzais72() nightfall} of 72 minutes
3865         * after sunset. This returns the time of 4 * {@link #getShaahZmanisMGA()} after {@link #getAlos72() dawn}. If it is not
3866         * <em>erev Pesach</em>, a null will be returned.
3867         * 
3868         * @return the <code>Date</code> of the latest time of eating <em>chametz</em>. If it is not <em>erev Pesach</em> or the
3869         *         calculation can't be computed such as in the Arctic Circle where there is at least one day a year where the sun does
3870         *         not rise, and one where it does not set, a <code>null</code> will be returned. See detailed explanation on top of
3871         *         the {@link AstronomicalCalendar} documentation.
3872         * @todo in v 3.0.0 enable the calendar check for erev pesach and return <code>null</code> in all other cases.
3873         * @see #getShaahZmanisMGA()
3874         * @see #getAlos72()
3875         * @see #getSofZmanTfilaMGA72Minutes()
3876         */
3877        public Date getSofZmanAchilasChametzMGA72Minutes() {
3878                /*JewishCalendar jewishCalendar = new JewishCalendar();
3879                jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
3880                                getCalendar().get(Calendar.DAY_OF_MONTH));
3881                if (jewishCalendar.getJewishMonth() == JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() == 14) {
3882                        return getSofZmanTfilaMGA72Minutes();
3883                } else {
3884                        return null;
3885                }*/
3886                return getSofZmanTfilaMGA72Minutes();
3887        }
3888        
3889        /**
3890         * This method returns the latest time one is allowed eating <em>chametz</em> on <em>Erev Pesach</em> according to the
3891         * opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on <em>alos</em>
3892         * being {@link #getAlos72Zmanis() 72 zmaniyos} minutes before {@link #getSunrise() sunrise}. This time is identical to the
3893         * {@link #getSofZmanTfilaMGA72MinutesZmanis() <em>Sof zman tfilah</em> MGA 72 minutes zmanis}. This time is 4 {@link #getShaahZmanis72MinutesZmanis()
3894         * <em>shaos zmaniyos</em>} (temporal hours) after {@link #getAlos72() dawn} based on the opinion of the MGA that the day is
3895         * calculated from a {@link #getAlos72Zmanis() dawn} of 72 minutes zmanis before sunrise to {@link #getTzais72Zmanis() nightfall} of 72 minutes zmanis
3896         * after sunset. This returns the time of 4 * {@link #getShaahZmanis72MinutesZmanis()} after {@link #getAlos72Zmanis() dawn}. If it is not
3897         * <em>erev Pesach</em>, a null will be returned.
3898         *
3899         * @return the <code>Date</code> of the latest time of eating <em>chametz</em>. If it is not <em>erev Pesach</em> or the
3900         *         calculation can't be computed such as in the Arctic Circle where there is at least one day a year where the sun does
3901         *         not rise, and one where it does not set, a <code>null</code> will be returned. See detailed explanation on top of
3902         *         the {@link AstronomicalCalendar} documentation.
3903         * @todo in v 3.0.0 enable the calendar check for erev pesach and return <code>null</code> in all other cases.
3904         * @see #getShaahZmanis72MinutesZmanis()
3905         * @see #getAlos72Zmanis()
3906         * @see #getSofZmanTfilaMGA72MinutesZmanis()
3907         */
3908        public Date getSofZmanAchilasChametzMGA72MinutesZmanis() {
3909                JewishCalendar jewishCalendar = new JewishCalendar();
3910                jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
3911                                getCalendar().get(Calendar.DAY_OF_MONTH));
3912                if (jewishCalendar.getJewishMonth() == JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() == 14) {
3913                        return getSofZmanTfilaMGA72MinutesZmanis();
3914                } else {
3915                        return null;
3916                }
3917        }
3918
3919        /**
3920         * This method returns the latest time one is allowed eating <em>chametz</em> on <em>Erev Pesach</em> according to the
3921         * opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on <em>alos</em>
3922         * being {@link #getAlos16Point1Degrees() 16.1&deg;} before {@link #getSunrise() sunrise}. This time is 4 {@link
3923         * #getShaahZmanis16Point1Degrees() <em>shaos zmaniyos</em>} (solar hours) after {@link #getAlos16Point1Degrees() dawn}
3924         * based on the opinion of the MGA that the day is calculated from dawn to nightfall with both being 16.1&deg;
3925         * below sunrise or sunset. This returns the time of 4 {@link #getShaahZmanis16Point1Degrees()} after
3926         * {@link #getAlos16Point1Degrees() dawn}. If it is not <em>erev Pesach</em>, a null will be returned.
3927         * 
3928         * @return the <code>Date</code> of the latest time of eating <em>chametz</em>. If it is not <em>erev Pesach</em> or the
3929         *         calculation can't be computed such as northern and southern locations even south of the Arctic Circle and north
3930         *         of the Antarctic Circle where the sun may not reach low enough below the horizon for this calculation, a
3931         *         <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
3932         * @todo in v 3.0.0 enable the calendar check for erev pesach and return <code>null</code> in all other cases.
3933         * @see #getShaahZmanis16Point1Degrees()
3934         * @see #getAlos16Point1Degrees()
3935         * @see #getSofZmanTfilaMGA16Point1Degrees()
3936         */
3937        public Date getSofZmanAchilasChametzMGA16Point1Degrees() {
3938                /*JewishCalendar jewishCalendar = new JewishCalendar();
3939                jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
3940                                getCalendar().get(Calendar.DAY_OF_MONTH));
3941                if (jewishCalendar.getJewishMonth() == JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() == 14) {
3942                        return getSofZmanTfilaMGA16Point1Degrees();
3943                } else {
3944                        return null;
3945                }*/
3946                return getSofZmanTfilaMGA16Point1Degrees();
3947        }
3948
3949        /**
3950         * FIXME adjust for synchronous
3951         * This method returns the latest time for burning <em>chametz</em> on <em>Erev Pesach</em> according to the opinion
3952         * of the <a href="https://en.wikipedia.org/wiki/Vilna_Gaon">GRA</a>. This time is 5 hours into the day based on the
3953         * opinion of the <a href="https://en.wikipedia.org/wiki/Vilna_Gaon">GRA</a> that the day is calculated from
3954         * sunrise to sunset. This returns the time 5 * {@link #getShaahZmanisGra()} after {@link #getSeaLevelSunrise() sea
3955         * level sunrise}. If it is not  <em>erev Pesach</em>, a null will be returned.
3956         * @todo in v 3.0.0 enable the calendar check for erev pesach and return <code>null</code> in all other cases.
3957         * @see ZmanimCalendar#getShaahZmanisGra()
3958         * @return the <code>Date</code> of the latest time for burning <em>chametz</em> on <em>Erev Pesach</em>. If it is not
3959         *         <em>erev Pesach</em> or the calculation can't be computed such as in the Arctic Circle where there is at least
3960         *         one day a year where the sun does not rise, and one where it does not set, a <code>null</code> will be
3961         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
3962         */
3963        public Date getSofZmanBiurChametzGRA() {
3964                /*JewishCalendar jewishCalendar = new JewishCalendar();
3965                jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
3966                                getCalendar().get(Calendar.DAY_OF_MONTH));
3967                if (jewishCalendar.getJewishMonth() == JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() == 14) {
3968                        return getTimeOffset(getElevationAdjustedSunrise(), getShaahZmanisGra() * 5);
3969                } else {
3970                        return null;
3971                }*/
3972                return getTimeOffset(getElevationAdjustedSunrise(), getShaahZmanisGra() * 5);
3973        }
3974
3975        /**
3976         * FIXME adjust for synchronous
3977         * This method returns the latest time for burning <em>chametz</em> on <em>Erev Pesach</em> according to the opinion of
3978         * the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on <em>alos</em>
3979         * being {@link #getAlos72() 72} minutes before {@link #getSunrise() sunrise}. This time is 5 {@link
3980         * #getShaahZmanisMGA() <em>shaos zmaniyos</em>} (temporal hours) after {@link #getAlos72() dawn} based on the opinion of
3981         * the MGA that the day is calculated from a {@link #getAlos72() dawn} of 72 minutes before sunrise to {@link
3982         * #getTzais72() nightfall} of 72 minutes after sunset. This returns the time of 5 * {@link #getShaahZmanisMGA()} after
3983         * {@link #getAlos72() dawn}. If it is not  <em>erev Pesach</em>, a null will be returned.
3984         * @todo in v 3.0.0 enable the calendar check for erev pesach and return <code>null</code> in all other cases.
3985         * @return the <code>Date</code> of the latest time for burning <em>chametz</em> on <em>Erev Pesach</em>. If it is not
3986         *         <em>erev Pesach</em> or the calculation can't be computed such as in the Arctic Circle where there is at
3987         *         least one day a year where the sun does not rise, and one where it does not set, a <code>null</code> will be
3988         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
3989         * @see #getShaahZmanisMGA()
3990         * @see #getAlos72()
3991         */
3992        public Date getSofZmanBiurChametzMGA72Minutes() {
3993                /*JewishCalendar jewishCalendar = new JewishCalendar();
3994                jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
3995                                getCalendar().get(Calendar.DAY_OF_MONTH));
3996                if (jewishCalendar.getJewishMonth() == JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() == 14) {
3997                        return getTimeOffset(getAlos72(), getShaahZmanisMGA() * 5);
3998                } else {
3999                        return null;
4000                }*/
4001                return getTimeOffset(getAlos72(), getShaahZmanisMGA() * 5);
4002        }
4003        
4004        /**
4005         * FIXME adjust for synchronous
4006         * This method returns the latest time for burning <em>chametz</em> on <em>Erev Pesach</em> according to the opinion of
4007         * the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on <em>alos</em>
4008         * being {@link #getAlos72Zmanis() 72} minutes zmanis before {@link #getSunrise() sunrise}. This time is 5 {@link
4009         * #getShaahZmanis72MinutesZmanis() <em>shaos zmaniyos</em>} (temporal hours) after {@link #getAlos72Zmanis() dawn} based on the opinion of
4010         * the MGA that the day is calculated from a {@link #getAlos72Zmanis() dawn} of 72 minutes zmanis before sunrise to {@link
4011         * #getTzais72Zmanis() nightfall} of 72 minutes zmanis after sunset. This returns the time of 5 * {@link #getShaahZmanis72MinutesZmanis()} after
4012         * {@link #getAlos72Zmanis() dawn}. If it is not  <em>erev Pesach</em>, a null will be returned.
4013         * @todo in v 3.0.0 enable the calendar check for erev pesach and return <code>null</code> in all other cases.
4014         * @return the <code>Date</code> of the latest time for burning <em>chametz</em> on <em>Erev Pesach</em>. If it is not
4015         *         <em>erev Pesach</em> or the calculation can't be computed such as in the Arctic Circle where there is at
4016         *         least one day a year where the sun does not rise, and one where it does not set, a <code>null</code> will be
4017         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
4018         * @see #getShaahZmanis72MinutesZmanis()
4019         * @see #getAlos72Zmanis()
4020         */
4021        public Date getSofZmanBiurChametzMGA72MinutesZmanis() {
4022                JewishCalendar jewishCalendar = new JewishCalendar();
4023                jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
4024                                getCalendar().get(Calendar.DAY_OF_MONTH));
4025                if (jewishCalendar.getJewishMonth() == JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() == 14) {
4026                        return getTimeOffset(getAlos72Zmanis(), getShaahZmanis72MinutesZmanis() * 5);
4027                } else {
4028                        return null;
4029                }
4030        }
4031
4032        /**
4033         * FIXME adjust for synchronous
4034         * This method returns the latest time for burning <em>chametz</em> on <em>Erev Pesach</em> according to the opinion
4035         * of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on <em>alos</em>
4036         * being {@link #getAlos16Point1Degrees() 16.1&deg;} before {@link #getSunrise() sunrise}. This time is 5
4037         * {@link #getShaahZmanis16Point1Degrees() <em>shaos zmaniyos</em>} (solar hours) after {@link #getAlos16Point1Degrees()
4038         * dawn} based on the opinion of the MGA that the day is calculated from dawn to nightfall with both being 16.1&deg;
4039         * below sunrise or sunset. This returns the time of 5 {@link #getShaahZmanis16Point1Degrees()} after
4040         * {@link #getAlos16Point1Degrees() dawn}. If it is not  <em>erev Pesach</em>, a null will be returned.
4041         * @todo in v 3.0.0 enable the calendar check for erev pesach and return <code>null</code> in all other cases.
4042         * @return the <code>Date</code> of the latest time for burning <em>chametz</em> on <em>Erev Pesach</em>. If it is not
4043         *         <em>erev Pesach</em> or the calculation can't be computed such as northern and southern locations even south
4044         *         of the Arctic Circle and north of the Antarctic Circle where the sun may not reach low enough below the
4045         *         horizon for this calculation, a <code>null</code> will be returned. See detailed explanation on top of the
4046         *         {@link AstronomicalCalendar} documentation.
4047         * 
4048         * @see #getShaahZmanis16Point1Degrees()
4049         * @see #getAlos16Point1Degrees()
4050         */
4051        public Date getSofZmanBiurChametzMGA16Point1Degrees() {
4052                /*JewishCalendar jewishCalendar = new JewishCalendar();
4053                jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
4054                                getCalendar().get(Calendar.DAY_OF_MONTH));
4055                if (jewishCalendar.getJewishMonth() == JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() == 14) {
4056                        return getTimeOffset(getAlos16Point1Degrees(), getShaahZmanis16Point1Degrees() * 5);
4057                } else {
4058                        return null;
4059                }*/
4060                return getTimeOffset(getAlos16Point1Degrees(), getShaahZmanis16Point1Degrees() * 5);
4061        }
4062
4063        /**
4064         * A method that returns the <a href="https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi">Baal Hatanya</a>'s
4065         * <em>netz amiti</em> (sunrise) without {@link AstronomicalCalculator#getElevationAdjustment(double)
4066         * elevation adjustment}. This forms the base for the Baal Hatanya's dawn-based calculations that are
4067         * calculated as a dip below the horizon before sunrise.
4068         *
4069         * According to the Baal Hatanya, <em>netz amiti</em>, or true (halachic) sunrise, is when the top of the sun's
4070         * disk is visible at an elevation similar to the mountains of Eretz Yisrael. The time is calculated as the point at which
4071         * the center of the sun's disk is 1.583&deg; below the horizon. This degree-based calculation can be found in Rabbi Shalom
4072         * DovBer Levine's commentary on The <a href="https://www.chabadlibrary.org/books/pdf/Seder-Hachnosas-Shabbos.pdf">Baal
4073         * Hatanya's Seder Hachnasas Shabbos</a>. From an elevation of 546 meters, the top of <a href=
4074         * "https://en.wikipedia.org/wiki/Mount_Carmel">Har Hacarmel</a>, the sun disappears when it is 1&deg; 35' or 1.583&deg;
4075         * below the sea level horizon. This in turn is based on the Gemara <a href=
4076         * "https://hebrewbooks.org/shas.aspx?mesechta=2&daf=35">Shabbos 35a</a>. There are other opinions brought down by
4077         * Rabbi Levine, including Rabbi Yosef Yitzchok Feigelstock who calculates it as the degrees below the horizon 4 minutes after
4078         * 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>
4079         * and is probably a typo and should be 1.683&deg;. These calculations are used by most <a href=
4080         * "https://en.wikipedia.org/wiki/Chabad">Chabad</a> calendars that use the Baal Hatanya's <em>zmanim</em>. See
4081         * <a href="https://www.chabad.org/library/article_cdo/aid/3209349/jewish/About-Our-Zmanim-Calculations.htm">About Our
4082         * <em>Zmanim</em> Calculations @ Chabad.org</a>.
4083         *
4084         * Note: <em>netz amiti</em> is used only for calculating certain <em>zmanim</em>, and is intentionally unpublished. For
4085         * practical purposes, daytime <em>mitzvos</em> like <em>shofar</em> and <em>lulav</em> should not be done until after the
4086         * published time for <em>netz</em> / sunrise.
4087         * 
4088         * @return the <code>Date</code> representing the exact sea level <em>netz amiti</em> (sunrise) time. If the calculation can't be
4089         *         computed such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
4090         *         where it does not set, a <code>null</code> will be returned. See detailed explanation on top of the page.
4091         * 
4092         * @see #getSunrise()
4093         * @see #getSeaLevelSunrise()
4094         * @see #getSunsetBaalHatanya()
4095         * @see #ZENITH_1_POINT_583
4096         */
4097        private Date getSunriseBaalHatanya() {
4098                return getSunriseOffsetByDegrees(ZENITH_1_POINT_583);
4099        }
4100
4101        /**
4102         * A method that returns the <a href="https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi">Baal Hatanya</a>'s
4103         * <em>shkiah amiti</em> (sunset) without {@link AstronomicalCalculator#getElevationAdjustment(double)
4104         * elevation adjustment}. This forms the base for the Baal Hatanya's dusk-based calculations that are calculated
4105         * as a dip below the horizon after sunset.
4106         * 
4107         * According to the Baal Hatanya, <em>shkiah amiti</em>, true (<em>halachic</em>) sunset, is when the top of the 
4108         * sun's disk disappears from view at an elevation similar to the mountains of <em>Eretz Yisrael</em>.
4109         * This time is calculated as the point at which the center of the sun's disk is 1.583 degrees below the horizon.
4110         *
4111         * Note: <em>shkiah amiti</em> is used only for calculating certain <em>zmanim</em>, and is intentionally unpublished. For
4112         * practical purposes, all daytime mitzvos should be completed before the published time for <em>shkiah</em> / sunset.
4113         *
4114         * For further explanation of the calculations used for the Baal Hatanya's <em>zmanim</em> in this library, see
4115         * <a href="https://www.chabad.org/library/article_cdo/aid/3209349/jewish/About-Our-Zmanim-Calculations.htm">About Our
4116         * <em>Zmanim</em> Calculations @ Chabad.org</a>.
4117         * 
4118         * @return the <code>Date</code> representing the exact sea level <em>shkiah amiti</em> (sunset) time. If the calculation
4119         *         can't be computed such as in the Arctic Circle where there is at least one day a year where the sun does not
4120         *         rise, and one where it does not set, a <code>null</code> will be returned. See detailed explanation on top of
4121         *         the {@link AstronomicalCalendar} documentation.
4122         * 
4123         * @see #getSunset()
4124         * @see #getSeaLevelSunset()
4125         * @see #getSunriseBaalHatanya()
4126         * @see #ZENITH_1_POINT_583
4127         */
4128        private Date getSunsetBaalHatanya() {
4129                return getSunsetOffsetByDegrees(ZENITH_1_POINT_583);
4130        }
4131
4132        /**
4133         * A method that returns the <a href="https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi">Baal Hatanya</a>'s
4134         * a <em>shaah zmanis</em> ({@link #getTemporalHour(Date, Date) temporal hour}). This forms the base for the
4135         * Baal Hatanya's  day  based calculations that are calculated as a 1.583&deg; dip below the horizon after sunset.
4136         * According to the Baal Hatanya, <em>shkiah amiti</em>, true (halachic) sunset, is when the top of the 
4137         * sun's disk disappears from view at an elevation similar to the mountains of Eretz Yisrael.
4138         * This time is calculated as the point at which the center of the sun's disk is 1.583 degrees below the horizon.
4139         * A method that returns a <em>shaah zmanis</em> ({@link #getTemporalHour(Date, Date) temporal hour}) calculated 
4140         * based on the <a href="https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi">Baal Hatanya</a>'s <em>netz
4141         * amiti</em> and <em>shkiah amiti</em> using a dip of 1.583&deg; below the sea level horizon. This calculation divides
4142         * the day based on the opinion of the Baal Hatanya that the day runs from {@link #getSunriseBaalHatanya() netz amiti}
4143         * to {@link #getSunsetBaalHatanya() <em>shkiah amiti</em>}. The calculations are based on a day from {@link
4144         * #getSunriseBaalHatanya() sea level <em>netz amiti</em>} to {@link #getSunsetBaalHatanya() sea level <em>shkiah amiti</em>}.
4145         * The day is split into 12 equal parts with each one being a <em>shaah zmanis</em>. This method is similar to {@link
4146         * #getTemporalHour}, but all calculations are based on a sea level sunrise and sunset.
4147         * @return the <code>long</code> millisecond length of a <em>shaah zmanis</em> calculated from
4148         *         {@link #getSunriseBaalHatanya() <em>netz amiti</em> (sunrise)} to {@link #getSunsetBaalHatanya() <em>shkiah amiti</em>
4149         *         ("real" sunset)}. If the calculation can't be computed such as in the Arctic Circle where there is at least one day a
4150         *         year where the sun does not rise, and one where it does not set, {@link Long#MIN_VALUE} will be returned. See
4151         *         detailed explanation on top of the {@link AstronomicalCalendar} documentation.
4152         * 
4153         * @see #getTemporalHour(Date, Date)
4154         * @see #getSunriseBaalHatanya()
4155         * @see #getSunsetBaalHatanya()
4156         * @see #ZENITH_1_POINT_583
4157         */
4158        public long getShaahZmanisBaalHatanya() {
4159                return getTemporalHour(getSunriseBaalHatanya(), getSunsetBaalHatanya());
4160        }
4161
4162        /**
4163         * Returns the <a href="https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi">Baal Hatanya</a>'s <em>alos</em>
4164         * (dawn) calculated as the time when the sun is 16.9&deg; below the eastern {@link #GEOMETRIC_ZENITH geometric horizon}
4165         * before {@link #getSunrise() sunrise}. For more information the source of 16.9&deg; see {@link #ZENITH_16_POINT_9}.
4166         * 
4167         * @see #ZENITH_16_POINT_9
4168         * @return The <code>Date</code> of dawn. If the calculation can't be computed such as northern and southern
4169         *         locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may not reach
4170         *         low enough below the horizon for this calculation, a <code>null</code> will be returned. See detailed
4171         *         explanation on top of the {@link AstronomicalCalendar} documentation.
4172         */
4173        public Date getAlosBaalHatanya() {
4174                return getSunriseOffsetByDegrees(ZENITH_16_POINT_9);
4175        }
4176
4177        /**
4178         * This method returns the latest <em>zman krias shema</em> (time to recite Shema in the morning). This time is 3
4179         * {@link #getShaahZmanisBaalHatanya() <em>shaos zmaniyos</em>} (solar hours) after {@link #getSunriseBaalHatanya() 
4180         * <em>netz amiti</em> (sunrise)} based on the opinion of the Baal Hatanya that the day is calculated from
4181         * sunrise to sunset. This returns the time 3 * {@link #getShaahZmanisBaalHatanya()} after {@link #getSunriseBaalHatanya() 
4182         * <em>netz amiti</em> (sunrise)}.
4183         * 
4184         * @see ZmanimCalendar#getSofZmanShma(Date, Date)
4185         * @see #getShaahZmanisBaalHatanya()
4186         * @return the <code>Date</code> of the latest <em>zman shema</em> according to the Baal Hatanya. If the calculation
4187         *         can't be computed such as in the Arctic Circle where there is at least one day a year where the sun does
4188         *         not rise, and one where it does not set, a <code>null</code> will be returned. See detailed explanation on
4189         *         top of the {@link AstronomicalCalendar} documentation.
4190         */
4191        public Date getSofZmanShmaBaalHatanya() {
4192                return getSofZmanShma(getSunriseBaalHatanya(), getSunsetBaalHatanya(), true);
4193        }
4194
4195        /**
4196         * This method returns the latest <em>zman tfilah</em> (time to recite the morning prayers). This time is 4
4197         * hours into the day based on the opinion of the Baal Hatanya that the day is
4198         * calculated from sunrise to sunset. This returns the time 4 * {@link #getShaahZmanisBaalHatanya()} after
4199         * {@link #getSunriseBaalHatanya() <em>netz amiti</em> (sunrise)}.
4200         * 
4201         * @see ZmanimCalendar#getSofZmanTfila(Date, Date)
4202         * @see #getShaahZmanisBaalHatanya()
4203         * @return the <code>Date</code> of the latest <em>zman tfilah</em>. If the calculation can't be computed such as in
4204         *         the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
4205         *         not set, a <code>null</code> will be returned. See detailed explanation on top of the
4206         *         {@link AstronomicalCalendar} documentation.
4207         */
4208        public Date getSofZmanTfilaBaalHatanya() {
4209                return getSofZmanTfila(getSunriseBaalHatanya(), getSunsetBaalHatanya(), true);
4210        }
4211
4212        /**
4213         * This method returns the latest time one is allowed eating <em>chametz</em> on <em>Erev Pesach</em> according to the
4214         * opinion of the Baal Hatanya. This time is identical to the {@link #getSofZmanTfilaBaalHatanya() <em>Sof zman
4215         * tfilah</em> Baal Hatanya}. This time is 4 hours into the day based on the opinion of the Baal Hatanya that the day
4216         * is calculated from sunrise to sunset. This returns the time 4 {@link #getShaahZmanisBaalHatanya()} after
4217         * {@link #getSunriseBaalHatanya() <em>netz amiti</em> (sunrise)}. If it is not  <em>erev Pesach</em>, a null will be
4218         * returned.
4219         * @todo in v 3.0.0 enable the calendar check for erev pesach and return <code>null</code> in all other cases.
4220         * @see #getShaahZmanisBaalHatanya()
4221         * @see #getSofZmanTfilaBaalHatanya()
4222         * @return the <code>Date</code> one is allowed eating <em>chametz</em> on <em>Erev Pesach</em>. If it is not <em>erev
4223         *         Pesach</em> or the  calculation can't be computed such as in the Arctic Circle where there is at least one
4224         *         day a year where the sun does not rise, and one where it does not set, a <code>null</code> will be returned.
4225         *         See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
4226         */
4227        public Date getSofZmanAchilasChametzBaalHatanya() {
4228                /*JewishCalendar jewishCalendar = new JewishCalendar();
4229                jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
4230                                getCalendar().get(Calendar.DAY_OF_MONTH));
4231                if (jewishCalendar.getJewishMonth() == JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() == 14) {
4232                        return getSofZmanTfilaBaalHatanya();
4233                } else {
4234                        return null;
4235                }*/
4236                return getSofZmanTfilaBaalHatanya();
4237        }
4238
4239        /**
4240         * This method returns the latest time for burning <em>chametz</em> on <em>Erev Pesach</em> according to the opinion of
4241         * the Baal Hatanya. This time is 5 hours into the day based on the opinion of the Baal Hatanya that the day is calculated
4242         * from sunrise to sunset. This returns the time 5 * {@link #getShaahZmanisBaalHatanya()} after
4243         * {@link #getSunriseBaalHatanya() <em>netz amiti</em> (sunrise)}. If it is not  <em>erev Pesach</em>, a null will be returned.
4244         * @todo in v 3.0.0 enable the calendar check for erev pesach and return <code>null</code> in all other cases.
4245         * @see #getShaahZmanisBaalHatanya()
4246         * @return the <code>Date</code> of the latest time for burning <em>chametz</em> on <em>Erev Pesach</em>.  If it is not
4247         *         <em>erev Pesach</em> or the  calculation can't be computed such as in the Arctic Circle where there is at
4248         *         least one day a year where the sun does not rise, and one where it does not set, a <code>null</code> will be
4249         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
4250         */
4251        public Date getSofZmanBiurChametzBaalHatanya() {
4252                /*JewishCalendar jewishCalendar = new JewishCalendar();
4253                jewishCalendar.setGregorianDate(getCalendar().get(Calendar.YEAR), getCalendar().get(Calendar.MONTH),
4254                                getCalendar().get(Calendar.DAY_OF_MONTH));
4255                if (jewishCalendar.getJewishMonth() == JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() == 14) {
4256                        return getTimeOffset(getSunriseBaalHatanya(), getShaahZmanisBaalHatanya() * 5);
4257                } else {
4258                        return null;
4259                }*/
4260                return getTimeOffset(getSunriseBaalHatanya(), getShaahZmanisBaalHatanya() * 5);
4261        }
4262
4263        /**
4264         * This method returns the time of <em>mincha gedola</em>. <em>Mincha gedola</em> is the earliest time one can pray
4265         * <em>mincha</em>. The <a href="https://en.wikipedia.org/wiki/Maimonides">Rambam</a> is of the opinion that it is
4266         * better to delay <em>mincha</em> until {@link #getMinchaKetanaBaalHatanya() <em>mincha ketana</em>} while the
4267         * <a href="https://en.wikipedia.org/wiki/Asher_ben_Jehiel">Ra"sh</a>,
4268         * <a href="https://en.wikipedia.org/wiki/Jacob_ben_Asher">Tur</a>, <a href=
4269         * "https://en.wikipedia.org/wiki/Vilna_Gaon">GRA</a> and others are of the opinion that <em>mincha</em> can be prayed
4270         * <em>lechatchila</em> starting at <em>mincha gedola</em>. This is calculated as 6.5 {@link #getShaahZmanisBaalHatanya()
4271         * sea level solar hours} after {@link #getSunriseBaalHatanya() <em>netz amiti</em> (sunrise)}. This calculation is based
4272         * on the opinion of the Baal Hatanya that the day is calculated from sunrise to sunset. This returns the time 6.5
4273         * * {@link #getShaahZmanisBaalHatanya()} after {@link #getSunriseBaalHatanya() <em>netz amiti</em> ("real" sunrise)}.
4274         * @todo Consider adjusting this to calculate the time as 30 clock or <em>zmaniyos </em> minutes after either {@link
4275         *         #getSunTransit() astronomical <em>chatzos</em>} or {@link #getChatzosAsHalfDay() <em>chatzos</em> as half a day}
4276         *         for {@link AstronomicalCalculator calculators} that support it, based on {@link #isUseAstronomicalChatzos()}.
4277         * @see #getMinchaGedola(Date, Date)
4278         * @see #getShaahZmanisBaalHatanya()
4279         * @see #getMinchaKetanaBaalHatanya()
4280         * @return the <code>Date</code> of the time of <em>mincha gedola</em> according to the Baal Hatanya. If the calculation
4281         *         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,
4282         *         and one where it does not set, a <code>null</code> will be returned. See detailed explanation on top of the
4283         *         {@link AstronomicalCalendar} documentation.
4284         */
4285        public Date getMinchaGedolaBaalHatanya() {
4286                return getMinchaGedola(getSunriseBaalHatanya(), getSunsetBaalHatanya(), true);
4287        }
4288
4289        /**
4290         * FIXME synchronous
4291         * This is a convenience method that returns the later of {@link #getMinchaGedolaBaalHatanya()} and
4292         * {@link #getMinchaGedola30Minutes()}. In the winter when 1/2 of a {@link #getShaahZmanisBaalHatanya()
4293         * <em>shaah zmanis</em>} is less than 30 minutes {@link #getMinchaGedola30Minutes()} will be returned, otherwise
4294         * {@link #getMinchaGedolaBaalHatanya()} will be returned.
4295         * @todo Consider adjusting this to calculate the time as 30 clock or <em>zmaniyos </em> minutes after either {@link
4296         *         #getSunTransit() astronomical <em>chatzos</em>} or {@link #getChatzosAsHalfDay() <em>chatzos</em> as half a day}
4297         *         for {@link AstronomicalCalculator calculators} that support it, based on {@link #isUseAstronomicalChatzos()}.
4298         * @return the <code>Date</code> of the later of {@link #getMinchaGedolaBaalHatanya()} and {@link #getMinchaGedola30Minutes()}.
4299         *         If the calculation can't be computed such as in the Arctic Circle where there is at least one day a year
4300         *         where the sun does not rise, and one where it does not set, a <code>null</code> will be returned. See detailed
4301         *         explanation on top of the {@link AstronomicalCalendar} documentation.
4302         */
4303        public Date getMinchaGedolaBaalHatanyaGreaterThan30() {
4304                if (getMinchaGedola30Minutes() == null || getMinchaGedolaBaalHatanya() == null) {
4305                        return null;
4306                } else {
4307                        return getMinchaGedola30Minutes().compareTo(getMinchaGedolaBaalHatanya()) > 0 ? getMinchaGedola30Minutes()
4308                                        : getMinchaGedolaBaalHatanya();
4309                }
4310        }
4311
4312        /**
4313         * This method returns the time of <em>mincha ketana</em>. This is the preferred earliest time to pray
4314         * <em>mincha</em> in the opinion of the <a href="https://en.wikipedia.org/wiki/Maimonides">Rambam</a> and others.
4315         * For more information on this see the documentation on {@link #getMinchaGedolaBaalHatanya() <em>mincha gedola</em>}.
4316         * This is calculated as 9.5 {@link #getShaahZmanisBaalHatanya()  sea level solar hours} after {@link #getSunriseBaalHatanya()
4317         * <em>netz amiti</em> (sunrise)}. This calculation is calculated based on the opinion of the Baal Hatanya that the
4318         * day is calculated from sunrise to sunset. This returns the time 9.5 * {@link #getShaahZmanisBaalHatanya()} after {@link
4319         * #getSunriseBaalHatanya() <em>netz amiti</em> (sunrise)}.
4320         * 
4321         * @see #getMinchaKetana(Date, Date)
4322         * @see #getShaahZmanisBaalHatanya()
4323         * @see #getMinchaGedolaBaalHatanya()
4324         * @return the <code>Date</code> of the time of <em>mincha ketana</em>. If the calculation can't be computed such as
4325         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
4326         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
4327         *         {@link AstronomicalCalendar} documentation.
4328         */
4329        public Date getMinchaKetanaBaalHatanya() {
4330                return getMinchaKetana(getSunriseBaalHatanya(), getSunsetBaalHatanya(), true);
4331        }
4332
4333        /**
4334         * This method returns the time of <em>plag hamincha</em>. This is calculated as 10.75 hours after sunrise. This
4335         * calculation is based on the opinion of the Baal Hatanya that the day is calculated
4336         * from sunrise to sunset. This returns the time 10.75 * {@link #getShaahZmanisBaalHatanya()} after
4337         * {@link #getSunriseBaalHatanya() <em>netz amiti</em> (sunrise)}.
4338         * 
4339         * @see #getPlagHamincha(Date, Date)
4340         * @return the <code>Date</code> of the time of <em>plag hamincha</em>. If the calculation can't be computed such as
4341         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
4342         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
4343         *         {@link AstronomicalCalendar} documentation.
4344         */
4345        public Date getPlagHaminchaBaalHatanya() {
4346                return getPlagHamincha(getSunriseBaalHatanya(), getSunsetBaalHatanya(), true);
4347        }
4348
4349        /**
4350         * A method that returns <em>tzais</em> (nightfall) when the sun is 6&deg; below the western geometric horizon
4351         * (90&deg;) after {@link #getSunset() sunset}. For information on the source of this calculation see
4352         * {@link #ZENITH_6_DEGREES}.
4353         * 
4354         * @return The <code>Date</code> of nightfall. If the calculation can't be computed such as northern and southern
4355         *         locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may not reach
4356         *         low enough below the horizon for this calculation, a <code>null</code> will be returned. See detailed
4357         *         explanation on top of the {@link AstronomicalCalendar} documentation.
4358         * @see #ZENITH_6_DEGREES
4359         */
4360        public Date getTzaisBaalHatanya() {
4361                return getSunsetOffsetByDegrees(ZENITH_6_DEGREES);
4362        }
4363        
4364        /**
4365         * A utility method to calculate zmanim based on <a href="https://en.wikipedia.org/wiki/Moshe_Feinstein">Rav Moshe
4366         * Feinstein</a> as calculated in <a href="https://en.wikipedia.org/wiki/Mesivtha_Tifereth_Jerusalem">MTJ</a>, <a href=
4367         * "https://en.wikipedia.org/wiki/Mesivtha_Tifereth_Jerusalem">Yeshiva of Staten Island</a>, and Camp Yeshiva
4368         * of Staten Island. The day is split in two, from <em>alos</em> / sunrise to fixed local <em>chatzos</em>, and the
4369         * second half of the day, from fixed local <em>chatzos</em> to sunset / <em>tzais</em>. Morning based times are calculated
4370         * based on the first 6 hours, and afternoon times based on the second half of the day.
4371         * @deprecated This method will be replaced in v3.0.0 by the more generic {@link
4372         *         ZmanimCalendar#getHalfDayBasedZman(Date, Date, double)} method.
4373         * 
4374         * @param startOfHalfDay
4375         *            The start of the half day. This would be <em>alos</em> or sunrise for morning based times and fixed
4376         *            local <em>chatzos</em> for the second half of the day.
4377         * @param endOfHalfDay
4378         *            The end of the half day. This would be fixed local <em>chatzos</em> for morning based times and sunset
4379         *            or <em>tzais</em> for afternoon based times.
4380         * @param hours
4381         *            the number of hours to offset the beginning of the first or second half of the day
4382         * 
4383         * @return the <code>Date</code> of the <em>zman</em> based on calculation of the first or second half of the day. If
4384         *         the calculation can't be computed such as in the Arctic Circle where there is at least one day a year where
4385         *         the sun does not rise, and one where it does not set, a <code>null</code> will be returned. See detailed
4386         *         explanation on top of the {@link AstronomicalCalendar} documentation.
4387         *
4388         * @see ComplexZmanimCalendar#getFixedLocalChatzos()
4389         * @see ZmanimCalendar#getHalfDayBasedZman(Date, Date, double)
4390         */
4391        @Deprecated // (forRemoval=true) // add back once Java 9 is the minimum supported version
4392        public Date getFixedLocalChatzosBasedZmanim(Date startOfHalfDay, Date endOfHalfDay, double hours) {
4393                return getHalfDayBasedZman(startOfHalfDay, endOfHalfDay, hours);
4394        }
4395        
4396        /**
4397         * This method returns <a href="https://en.wikipedia.org/wiki/Moshe_Feinstein">Rav Moshe Feinstein's</a> opinion of the
4398         * calculation of <em>sof zman krias shema</em> (latest time to recite <em>Shema</em> in the morning) according to the
4399         * opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> that the
4400         * day is calculated from dawn to nightfall, but calculated using the first half of the day only. The half a day starts
4401         * at <em>alos</em> defined as {@link #getAlos18Degrees() 18&deg;} and ends at {@link #getFixedLocalChatzos() fixed local
4402         * chatzos}. <em>Sof Zman Shema</em> is 3 <em>shaos zmaniyos</em> (solar hours) after <em>alos</em> or half of this half-day.
4403         * 
4404         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
4405         *         as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
4406         *         where the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be
4407         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
4408         * @see #getAlos18Degrees()
4409         * @see #getFixedLocalChatzos()
4410         * @see ZmanimCalendar#getHalfDayBasedZman(Date, Date, double)
4411         */
4412        public Date getSofZmanShmaMGA18DegreesToFixedLocalChatzos() {
4413                return getHalfDayBasedZman(getAlos18Degrees(), getFixedLocalChatzos(), 3);
4414        }
4415        
4416        /**
4417         * This method returns <a href="https://en.wikipedia.org/wiki/Moshe_Feinstein">Rav Moshe Feinstein's</a> opinion of the
4418         * calculation of <em>sof zman krias shema</em> (latest time to recite <em>Shema</em> in the morning) according to the
4419         * opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> that the
4420         * day is calculated from dawn to nightfall, but calculated using the first half of the day only. The half a day starts
4421         * at <em>alos</em> defined as {@link #getAlos16Point1Degrees() 16.1&deg;} and ends at {@link #getFixedLocalChatzos() fixed local
4422         * 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.
4423         * 
4424         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
4425         *         as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
4426         *         where the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be returned.
4427         *         See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
4428         * @see #getAlos16Point1Degrees()
4429         * @see #getFixedLocalChatzos()
4430         * @see #getHalfDayBasedZman(Date, Date, double)
4431         */
4432        public Date getSofZmanShmaMGA16Point1DegreesToFixedLocalChatzos() {
4433                return getHalfDayBasedZman(getAlos16Point1Degrees(), getFixedLocalChatzos(), 3);
4434        }
4435        
4436        /**
4437         * This method returns <a href="https://en.wikipedia.org/wiki/Moshe_Feinstein">Rav Moshe Feinstein's</a> opinion of the
4438         * calculation of <em>sof zman krias shema</em> (latest time to recite <em>Shema</em> in the morning) according to the
4439         * opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> that the
4440         * day is calculated from dawn to nightfall, but calculated using the first half of the day only. The half a day starts
4441         * at <em>alos</em> defined as {@link #getAlos90() 90 minutes before sunrise} and ends at {@link #getFixedLocalChatzos()
4442         * fixed local chatzos}. <em>Sof Zman Shema</em> is 3 <em>shaos zmaniyos</em> (solar hours) after this <em>alos</em> or
4443         * half of this half-day.
4444         * 
4445         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
4446         *         as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
4447         *         where the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be
4448         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
4449         * @see #getAlos90()
4450         * @see #getFixedLocalChatzos()
4451         * @see #getHalfDayBasedZman(Date, Date, double)
4452         */
4453        public Date getSofZmanShmaMGA90MinutesToFixedLocalChatzos() {
4454                return getHalfDayBasedZman(getAlos90(), getFixedLocalChatzos(), 3);
4455        }
4456        
4457        /**
4458         * This method returns <a href="https://en.wikipedia.org/wiki/Moshe_Feinstein">Rav Moshe Feinstein's</a> opinion of the
4459         * calculation of <em>sof zman krias shema</em> (latest time to recite <em>Shema</em> in the morning) according to the
4460         * opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> that the
4461         * day is calculated from dawn to nightfall, but calculated using the first half of the day only. The half a day starts
4462         * at <em>alos</em> defined as {@link #getAlos72() 72 minutes before sunrise} and ends at {@link #getFixedLocalChatzos()
4463         * fixed local chatzos}. <em>Sof Zman Shema</em> is 3 <em>shaos zmaniyos</em> (solar hours) after this <em>alos</em> or
4464         * half of this half-day.
4465         * 
4466         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
4467         *         as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
4468         *         where the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be
4469         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
4470         * @see #getAlos72()
4471         * @see #getFixedLocalChatzos()
4472         * @see #getHalfDayBasedZman(Date, Date, double)
4473         */
4474        public Date getSofZmanShmaMGA72MinutesToFixedLocalChatzos() {
4475                return getHalfDayBasedZman(getAlos72(), getFixedLocalChatzos(), 3);
4476        }
4477                
4478        /**
4479         * This method returns <a href="https://en.wikipedia.org/wiki/Moshe_Feinstein">Rav Moshe Feinstein's</a> opinion of the
4480         * calculation of <em>sof zman krias shema</em> (latest time to recite <em>Shema</em> in the morning) according to the
4481         * opinion of the <a href="https://en.wikipedia.org/wiki/Vilna_Gaon">GRA</a> that the day is calculated from
4482         * sunrise to sunset, but calculated using the first half of the day only. The half a day starts at {@link #getSunrise()
4483         * sunrise} and ends at {@link #getFixedLocalChatzos() fixed local chatzos}. <em>Sof zman Shema</em> is 3 <em>shaos
4484         * zmaniyos</em> (solar hours) after sunrise or half of this half-day.
4485         * 
4486         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
4487         *         as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
4488         *         where the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be
4489         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
4490         * @see #getSunrise()
4491         * @see #getFixedLocalChatzos()
4492         * @see #getHalfDayBasedZman(Date, Date, double)
4493         */
4494        public Date getSofZmanShmaGRASunriseToFixedLocalChatzos() {
4495                return getHalfDayBasedZman(getElevationAdjustedSunrise(), getFixedLocalChatzos(), 3);
4496        }
4497        
4498        /**
4499         * This method returns <a href="https://en.wikipedia.org/wiki/Moshe_Feinstein">Rav Moshe Feinstein's</a> opinion of the
4500         * calculation of <em>sof zman tfila</em> (<em>zman tfilah</em> (the latest time to recite the morning prayers))
4501         * according to the opinion of the <a href="https://en.wikipedia.org/wiki/Vilna_Gaon">GRA</a> that the day is
4502         * calculated from sunrise to sunset, but calculated using the first half of the day only. The half a day starts at
4503         * {@link #getSunrise() sunrise} and ends at {@link #getFixedLocalChatzos() fixed local chatzos}. <em>Sof zman tefila</em>
4504         * is 4 <em>shaos zmaniyos</em> (solar hours) after sunrise or 2/3 of this half-day.
4505         * 
4506         * @return the <code>Date</code> of the latest <em>zman krias shema</em>. If the calculation can't be computed such
4507         *         as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
4508         *         where the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be
4509         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
4510         * @see #getSunrise()
4511         * @see #getFixedLocalChatzos()
4512         * @see #getHalfDayBasedZman(Date, Date, double)
4513         */
4514        public Date getSofZmanTfilaGRASunriseToFixedLocalChatzos() {
4515                return getHalfDayBasedZman(getElevationAdjustedSunrise(), getFixedLocalChatzos(), 4);
4516        }
4517        
4518        /**
4519         * This method returns <a href="https://en.wikipedia.org/wiki/Moshe_Feinstein">Rav Moshe Feinstein's</a> opinion of
4520         * the calculation of <em>mincha gedola</em>, the earliest time one can pray <em>mincha</em> <a href=
4521         * "https://en.wikipedia.org/wiki/Vilna_Gaon">GRA</a> that is 30 minutes after {@link #getFixedLocalChatzos() fixed
4522         * local chatzos}.
4523         * 
4524         * @return the <code>Date</code> of the time of <em>mincha gedola</em>. If the calculation can't be computed such as
4525         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
4526         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
4527         *         {@link AstronomicalCalendar} documentation.
4528         * 
4529         * @see #getMinchaGedola()
4530         * @see #getFixedLocalChatzos()
4531         * @see #getMinchaKetanaGRAFixedLocalChatzosToSunset
4532         */
4533        public Date getMinchaGedolaGRAFixedLocalChatzos30Minutes() {
4534                return getTimeOffset(getFixedLocalChatzos(), MINUTE_MILLIS * 30);
4535        }
4536        
4537        /**
4538         * This method returns <a href="https://en.wikipedia.org/wiki/Moshe_Feinstein">Rav Moshe Feinstein's</a> opinion
4539         * of the calculation of <em>mincha ketana</em> (the preferred time to recite the <em>mincha prayers</em> according to
4540         * the opinion of the <a href="https://en.wikipedia.org/wiki/Maimonides">Rambam</a> and others) calculated according
4541         * to the <a href="https://en.wikipedia.org/wiki/Vilna_Gaon">GRA</a> that is 3.5 <em>shaos zmaniyos</em> (solar
4542         * hours) after {@link #getFixedLocalChatzos() fixed local chatzos}.
4543         * 
4544         * @return the <code>Date</code> of the time of <em>mincha gedola</em>. If the calculation can't be computed such as
4545         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
4546         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
4547         *         {@link AstronomicalCalendar} documentation.
4548         *         
4549         * @see #getMinchaGedola()
4550         * @see #getFixedLocalChatzos()
4551         * @see #getMinchaGedolaGRAFixedLocalChatzos30Minutes
4552         * @see ZmanimCalendar#getHalfDayBasedZman(Date, Date, double)
4553         */
4554        public Date getMinchaKetanaGRAFixedLocalChatzosToSunset() {
4555                return getHalfDayBasedZman(getFixedLocalChatzos(), getElevationAdjustedSunset(), 3.5);
4556        }
4557        
4558        /**
4559         * This method returns <a href="https://en.wikipedia.org/wiki/Moshe_Feinstein">Rav Moshe Feinstein's</a> opinion
4560         * of the calculation of <em>plag hamincha</em>. This method returns <em>plag hamincha</em> calculated according to the
4561         * <a href="https://en.wikipedia.org/wiki/Vilna_Gaon">GRA</a> that the day ends at sunset and is 4.75 <em>shaos
4562         * zmaniyos</em> (solar hours) after {@link #getFixedLocalChatzos() fixed local chatzos}.
4563         * 
4564         * @return the <code>Date</code> of the time of <em>mincha gedola</em>. If the calculation can't be computed such as
4565         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
4566         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the
4567         *         {@link AstronomicalCalendar} documentation.
4568         *         
4569         * @see #getPlagHamincha()
4570         * @see #getFixedLocalChatzos()
4571         * @see #getMinchaKetanaGRAFixedLocalChatzosToSunset
4572         * @see #getMinchaGedolaGRAFixedLocalChatzos30Minutes
4573         * @see ZmanimCalendar#getHalfDayBasedZman(Date, Date, double)
4574         */
4575        public Date getPlagHaminchaGRAFixedLocalChatzosToSunset() {
4576                return getHalfDayBasedZman(getFixedLocalChatzos(), getElevationAdjustedSunset(), 4.75);
4577        }
4578        
4579        /**
4580         * Method to return <em>tzais</em> (dusk) calculated as 50 minutes after sea level sunset. This method returns
4581         * <em>tzais</em> (nightfall) based on the opinion of Rabbi Moshe Feinstein for the New York area. This time should
4582         * not be used for latitudes other than ones similar to the latitude of the NY area.
4583         * 
4584         * @return the <code>Date</code> representing the time. If the calculation can't be computed such as in the Arctic
4585         *         Circle where there is at least one day a year where the sun does not rise, and one where it does not set,
4586         *         a <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
4587         *         documentation.
4588         */
4589        public Date getTzais50() {
4590                return getTimeOffset(getElevationAdjustedSunset(), 50 * MINUTE_MILLIS);
4591        }
4592        
4593        /**
4594         * A method for calculating <em>samuch lemincha ketana</em>, / near <em>mincha ketana</em> time that is half an hour before
4595         * {@link #getMinchaKetana()} or is 9 * {@link #getShaahZmanisGra() <em>shaos zmaniyos</em>} (solar hours) after {@link
4596         * #getSunrise() sunrise} or {@link #getSeaLevelSunrise() sea level sunrise} (depending on the {@link #isUseElevation()}
4597         * setting), calculated according to the <a href="https://en.wikipedia.org/wiki/Vilna_Gaon">GRA</a> using a day starting at
4598         * sunrise and ending at sunset. This is the time that eating or other activity can't begin prior to praying <em>mincha</em>.
4599         * The calculation used is 9 * {@link #getShaahZmanis16Point1Degrees()} after {@link #getAlos16Point1Degrees() <em>alos</em>
4600         * 16.1&deg;}. See the <a href="https://hebrewbooks.org/pdfpager.aspx?req=60387&st=&pgnum=294">Mechaber and Mishna Berurah
4601         * 232</a> and <a href="https://hebrewbooks.org/pdfpager.aspx?req=60388&pgnum=34">249:2</a>.
4602         * 
4603         * @see #getShaahZmanisGra()
4604         * @see #getSamuchLeMinchaKetana16Point1Degrees()
4605         * @see #isUseAstronomicalChatzosForOtherZmanim()
4606         * @return the <code>Date</code> of the time of <em>samuch lemincha ketana</em>. If the calculation can't be computed such
4607         *         as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
4608         *         where the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be
4609         *         returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
4610         */
4611        public Date getSamuchLeMinchaKetanaGRA() {
4612                return getSamuchLeMinchaKetana(getElevationAdjustedSunrise(), getElevationAdjustedSunset(), true);
4613        }
4614        
4615        /**
4616         * A method for calculating <em>samuch lemincha ketana</em>, / near <em>mincha ketana</em> time that is half an hour
4617         * before {@link #getMinchaGedola16Point1Degrees()}  or 9 * <em>shaos zmaniyos</em> (temporal hours) after the start of
4618         * the day, calculated using a day starting and ending 16.1&deg; below the horizon. This is the time that eating or other
4619         * activity can't begin prior to praying <em>mincha</em>. The calculation used is 9 * {@link
4620         * #getShaahZmanis16Point1Degrees()} after {@link #getAlos16Point1Degrees() <em>alos</em> 16.1&deg;}. See the <a href=
4621         * "https://hebrewbooks.org/pdfpager.aspx?req=60387&st=&pgnum=294">Mechaber and Mishna Berurah 232</a> and <a href=
4622         * "https://hebrewbooks.org/pdfpager.aspx?req=60388&pgnum=34">249:2</a>.
4623         * 
4624         * @see #getShaahZmanis16Point1Degrees()
4625         * @return the <code>Date</code> of the time of <em>samuch lemincha ketana</em>. If the calculation can't be computed such
4626         *         as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
4627         *         where the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be returned.
4628         *         See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
4629         */
4630        public Date getSamuchLeMinchaKetana16Point1Degrees() {
4631                return getSamuchLeMinchaKetana(getAlos16Point1Degrees(), getTzais16Point1Degrees(), true);
4632        }
4633        
4634        /**
4635         * A method for calculating <em>samuch lemincha ketana</em>, / near <em>mincha ketana</em> time that is half an hour before
4636         * {@link #getMinchaKetana72Minutes()}  or 9 * <em>shaos zmaniyos</em> (temporal hours) after the start of the day,
4637         * calculated using a day starting 72 minutes before sunrise and ending 72 minutes after sunset. This is the time that eating
4638         * or other activity can't begin prior to praying <em>mincha</em>. The calculation used is 9 * {@link
4639         * #getShaahZmanis16Point1Degrees()} after {@link #getAlos16Point1Degrees() <em>alos</em> 16.1&deg;}. See the <a href=
4640         * "https://hebrewbooks.org/pdfpager.aspx?req=60387&st=&pgnum=294">Mechaber and Mishna Berurah 232</a> and <a href=
4641         * "https://hebrewbooks.org/pdfpager.aspx?req=60388&pgnum=34">249:2</a>.
4642         * 
4643         * @see #getShaahZmanis16Point1Degrees()
4644         * @return the <code>Date</code> of the time of <em>samuch lemincha ketana</em>. If the calculation can't be computed such
4645         *         as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
4646         *         where the sun may not reach low enough below the horizon for this calculation, a <code>null</code> will be returned.
4647         *         See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
4648         */
4649        public Date getSamuchLeMinchaKetana72Minutes() {
4650                return getSamuchLeMinchaKetana(getAlos72(), getTzais72(), true);
4651        }
4652        
4653        /**
4654         * This method returns the time for <em>tzais hacochavim</em> (nightfall) according to the opinion of the Geonim,
4655         * calculated as 13.5 minutes <em>zmaniyos</em> (based on 3/4 of an 18-minute <em>mil</em> after sunset. This is a
4656         * very early <em>zman</em> mentioned in the Yalkut Yosef on <a href=
4657         * "https://hebrewbooks.org/pdfpager.aspx?req=56810&st=&pgnum=247">Hilchos Chanukah siman 672</a>, and it should not
4658         * be used without <em>halachic</em> guidance! It certainly should never be used for the end of <em>Shabbos</em>. To
4659         * illustrate how short the time can be between sunset and this <em>tzais</em>, calculations at the winter solstice
4660         * (when the day is shortest) show that it occurs as 11 minutes and 20 seconds after sunset in Yerushalayim, 10
4661         * minutes and 19 seconds in Lakewood, NJ, 9 minutes and 47 seconds in Montreal and only 8 minutes and 5 seconds after
4662         * sunset in Gateshead, England. Conversely, at the summer solstice the times will be longer than 13.5 minutes.
4663         *
4664         * @deprecated This is a very early <em>zman</em>, and it should not be used without <em>halachic</em> guidance. It
4665         *         should never be used for calculaing the end of <em>Shabbos</em>.
4666         * @return the <code>Date</code> of the time of <em>tzais</em>.  If the calculation can't be computed such as in
4667         *         the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
4668         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the {@link
4669         *         AstronomicalCalendar} documentation.
4670         * @see #getTzaisGeonimYalkutYosef20MinutesZmanis()
4671         */
4672        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
4673        public Date getTzaisGeonimYalkutYosef13Point5MinutesZmanis() {
4674                return getZmanisBasedOffset(13.5 / 60); // 13.5 minutes zmaniyos after sunset
4675        }
4676        
4677        /**
4678         * This method returns the time for <em>tzais hacochavim</em> (nightfall) according to the opinion of the Geonim,
4679         * calculated as 20 minutes <em>zmaniyos</em> after sunset. This is a very early <em>zman</em>, and it should not be
4680         * used without <em>halachic</em> guidance! It certainly should never be used for the end of <em>Shabbos</em>.
4681         * FIXME - add more documentation
4682         * @todo sources.
4683         * @return the <code>Date</code> of the time of <em>tzais</em>.  If the calculation can't be computed such as in
4684         *         the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
4685         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the {@link
4686         *         AstronomicalCalendar} documentation.
4687         *  @see #getTzaisGeonimYalkutYosef13Point5MinutesZmanis()
4688         */
4689        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
4690        public Date getTzaisGeonimYalkutYosef20MinutesZmanis() {
4691                return getZmanisBasedOffset(20.0 / 60); // 20 minutes zmaniyos after sunset
4692        }
4693        
4694        /**
4695         * A method for calculating <em>plag hamincha</em> based on the calculations of the Yalkut Yosef. This calculation
4696         * subtracts 1.25 <em>shaaos zmaniyos</em> from sunrise to sunset (elevation adjusted if {@link #isUseElevation()}
4697         * is set to true) from {@link #getTzaisGeonimYalkutYosef13Point5MinutesZmanis()}.
4698         * 
4699         * @return the <code>Date</code> of the time of <em>plag hamincha</em>. If the calculation can't be computed such as
4700         *         in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
4701         *         does not set, a <code>null</code> will be returned. See detailed explanation on top of the {@link
4702         *         AstronomicalCalendar} documentation.
4703         * @see #getTzaisGeonimYalkutYosef13Point5MinutesZmanis()
4704         * @see #getShaahZmanisGra()
4705         * FIXME sources.
4706         * @todo sources
4707         */
4708        public Date getPlagHaminchaYalkutYosef() {
4709                return getTimeOffset(getTzaisGeonimYalkutYosef13Point5MinutesZmanis(), - (getShaahZmanisGra() * 1.25));
4710        }
4711        
4712        /**
4713         * This method returns the time for <em>misheyakir</em> calculated as 66 minutes <em>zmaniyos</em> before sunrise
4714         * following the calculation used in the Ohr Hachaim calendar based on Rav Ovadya Yosef in Yechave Daat 2:8. The
4715         * 66 minutes is based on the Pri Megadim in Eishel Avraham 58:2. This is a very early zman, and it should not be
4716         * used without <em>halachic</em> guidance.
4717         * 
4718         * @deprecated This is a very early <em>zman</em>, and it should not be used without <em>halachic</em> guidance.
4719         * 
4720         * @return the <code>Date</code> of the time of <em>misheyakir</em>. If the calculation can't be computed such as in
4721         *         the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
4722         *         not set, a <code>null</code> will be returned. See detailed explanation on top of the {@link
4723         *         AstronomicalCalendar} documentation.
4724         */
4725        @Deprecated // (forRemoval=false) // add back once Java 9 is the minimum supported version
4726        public Date getMisheyakirYalkutYosef66MinutesZmanis() {
4727                return getZmanisBasedOffset(-1.1); // 66 minutes zmaniyos (1.1 hours) before sunrise
4728        }
4729}