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