rust_zmanim/complex_zmanim_calendar/czc_struct.rs
1use crate::{
2 util::geolocation::GeoLocation,
3 zmanim_calculator::{
4 self,
5 ZmanOffset::{self, Degrees, Minutes, MinutesZmaniyos},
6 },
7};
8
9use jiff::{SignedDuration, Zoned, civil::Date};
10
11/// Struct to store a 4-dimensional location and settings, to simplify getting
12/// many *zmanim* for the same location. Has premade methods for many common
13/// (and uncommon) *zmanim*. (see `impl` block)
14#[derive(Debug, Clone, PartialEq)]
15pub struct ComplexZmanimCalendar {
16 /// Location at which to calculate *zmanim*
17 pub geo_location: GeoLocation,
18
19 /// Day for which to calculate *zmanim*
20 pub date: Date,
21
22 /// When to account for elevation. See [`UseElevation`]
23 pub use_elevation: UseElevation,
24}
25
26/// Where unspecified, when sunrise and sunset are mentioned in the calculation
27/// of other *zmanim*, they will be sea-level or elevation-based depending on
28/// the value of `use_elevation`
29///
30/// **Elevation-based *zmanim* (even sunrise and sunset) should not be used
31/// *lekula* without the guidance of a *posek***. See the documentation of
32/// [`zmanim_calculator`] for more details.
33///
34/// Many of the methods return `None` if the sun does not reach the specified
35/// position below the horizon at this location and date (common in polar
36/// regions).
37impl ComplexZmanimCalendar {
38 // Basics
39 /// Returns *alos hashachar* (dawn) based on either declination of the sun
40 /// below the horizon, a fixed time offset, or a minutes *zmaniyos*
41 /// (temporal minutes) offset before sunrise
42 #[must_use]
43 pub fn alos(&self, offset: &ZmanOffset) -> Option<Zoned> {
44 let use_elevation = self.use_elevation.to_bool(false);
45 zmanim_calculator::alos(&self.date, &self.geo_location, use_elevation, offset)
46 }
47
48 /// Returns sea level sunrise
49 #[must_use]
50 pub fn sea_level_sunrise(&self) -> Option<Zoned> {
51 zmanim_calculator::hanetz(&self.date, &self.geo_location, false)
52 }
53
54 /// Returns sea level sunset
55 #[must_use]
56 pub fn sea_level_sunset(&self) -> Option<Zoned> {
57 zmanim_calculator::shkia(&self.date, &self.geo_location, false)
58 }
59
60 /// Returns elevation-adjusted sunrise
61 #[must_use]
62 pub fn elevation_sunrise(&self) -> Option<Zoned> {
63 zmanim_calculator::hanetz(&self.date, &self.geo_location, true)
64 }
65
66 /// Returns elevation-adjusted sunset
67 #[must_use]
68 pub fn elevation_sunset(&self) -> Option<Zoned> {
69 zmanim_calculator::shkia(&self.date, &self.geo_location, true)
70 }
71
72 /// Returns *hanetz*, or sunrise. Will be elevation-adjusted or not
73 /// depending on `use_elevation`
74 #[must_use]
75 pub fn hanetz(&self) -> Option<Zoned> {
76 let use_elevation = self.use_elevation.to_bool(true);
77 zmanim_calculator::hanetz(&self.date, &self.geo_location, use_elevation)
78 }
79
80 /// Returns *shkia*, or sunset. Will be elevation-adjusted or not depending
81 /// on `use_elevation`
82 #[must_use]
83 pub fn shkia(&self) -> Option<Zoned> {
84 let use_elevation = self.use_elevation.to_bool(true);
85 zmanim_calculator::shkia(&self.date, &self.geo_location, use_elevation)
86 }
87
88 /// Returns sunrise, for use internally. Will be elevation-adjusted only if
89 /// `use_elevation == All`
90 #[must_use]
91 fn zmanim_sunrise(&self) -> Option<Zoned> {
92 let use_elevation = self.use_elevation.to_bool(false);
93 zmanim_calculator::hanetz(&self.date, &self.geo_location, use_elevation)
94 }
95
96 /// Returns sunset, for use internally. Will be elevation-adjusted only if
97 /// `use_elevation == All`
98 #[must_use]
99 fn zmanim_sunset(&self) -> Option<Zoned> {
100 let use_elevation = self.use_elevation.to_bool(false);
101 zmanim_calculator::shkia(&self.date, &self.geo_location, use_elevation)
102 }
103
104 /// Returns the latest *zman krias shema* (time to recite *Shema* in the
105 /// morning) according to the opinion of the *Magen Avraham* (MGA) based on
106 /// *alos* and *tzeis* being given offset from sunrise and sunset,
107 /// respectively.
108 #[must_use]
109 pub fn sof_zman_shema_mga(&self, offset: &ZmanOffset) -> Option<Zoned> {
110 Some(zmanim_calculator::sof_zman_shema(
111 &self.alos(offset)?,
112 &self.tzeis(offset)?,
113 ))
114 }
115
116 /// Returns the latest *zman tefila* (time to recite *shacharis* in the
117 /// morning) according to the opinion of the *Magen Avraham* (MGA) based on
118 /// *alos* and *tzeis* being the given offset from sunrise and sunset,
119 /// respectively.
120 #[must_use]
121 pub fn sof_zman_tefila_mga(&self, offset: &ZmanOffset) -> Option<Zoned> {
122 Some(zmanim_calculator::sof_zman_tefila(
123 &self.alos(offset)?,
124 &self.tzeis(offset)?,
125 ))
126 }
127
128 /// Returns the latest *zman biur chametz* (the latest time for burning
129 /// *chametz* on *Erev Pesach*) according to the opinion of the *Magen
130 /// Avraham* (MGA) based on *alos* and *tzeis* being the given offset
131 /// from sunrise and sunset, respectively.
132 #[must_use]
133 pub fn sof_zman_biur_chametz_mga(&self, offset: &ZmanOffset) -> Option<Zoned> {
134 Some(zmanim_calculator::sof_zman_biur_chametz(
135 &self.alos(offset)?,
136 &self.tzeis(offset)?,
137 ))
138 }
139
140 /// Returns Astronomical *chatzos* (noon)
141 #[must_use]
142 pub fn chatzos(&self) -> Option<Zoned> {
143 zmanim_calculator::chatzos(&self.date, &self.geo_location)
144 }
145
146 /// Returns Astronomical *chatzos halayla* (midnight)
147 #[must_use]
148 pub fn chatzos_halayla(&self) -> Option<Zoned> {
149 zmanim_calculator::chatzos_halayla(&self.date, &self.geo_location)
150 }
151
152 /// Returns *mincha gedola* according to the opinion of the *Magen Avraham*
153 /// (MGA) based on *alos* and *tzeis* being the given offset from sunrise
154 /// and sunset, respectively.
155 #[must_use]
156 pub fn mincha_gedola_mga(&self, offset: &ZmanOffset) -> Option<Zoned> {
157 Some(zmanim_calculator::mincha_gedola(
158 &self.alos(offset)?,
159 &self.tzeis(offset)?,
160 ))
161 }
162
163 /// Returns *samuch lemincha ketana* according to the opinion of the *Magen
164 /// Avraham* (MGA) based on *alos* and *tzeis* being the given offset
165 /// from sunrise and sunset, respectively.
166 #[must_use]
167 pub fn samuch_lemincha_ketana_mga(&self, offset: &ZmanOffset) -> Option<Zoned> {
168 Some(zmanim_calculator::samuch_lemincha_ketana(
169 &self.alos(offset)?,
170 &self.tzeis(offset)?,
171 ))
172 }
173
174 /// Returns *mincha ketana* according to the opinion of the *Magen Avraham*
175 /// (MGA) based on *alos* and *tzeis* being the given offset from sunrise
176 /// and sunset, respectively.
177 #[must_use]
178 pub fn mincha_ketana_mga(&self, offset: &ZmanOffset) -> Option<Zoned> {
179 Some(zmanim_calculator::mincha_ketana(
180 &self.alos(offset)?,
181 &self.tzeis(offset)?,
182 ))
183 }
184
185 /// Returns *plag hamincha* according to the opinion of the *Magen Avraham*
186 /// (MGA) based on *alos* and *tzeis* being the given offset from sunrise
187 /// and sunset, respectively.
188 #[must_use]
189 pub fn plag_mga(&self, offset: &ZmanOffset) -> Option<Zoned> {
190 Some(zmanim_calculator::plag_hamincha(
191 &self.alos(offset)?,
192 &self.tzeis(offset)?,
193 ))
194 }
195
196 /// Returns *mincha gedola* calculated as 30 minutes after *chatzos* and not
197 /// 1/2 of a *shaah zmanis* after *chatzos* as calculated by
198 /// [`zmanim_calculator::mincha_gedola`]. See
199 /// [`zmanim_calculator::mincha_gedola_30_minutes`] for more details
200 #[must_use]
201 pub fn mincha_gedola_30_minutes(&self) -> Option<Zoned> {
202 zmanim_calculator::mincha_gedola_30_minutes(&self.date, &self.geo_location)
203 }
204
205 /// Returns *tzeis* (nightfall) based on either declination of the sun below
206 /// the horizon, a fixed time offset, or a minutes *zmaniyos* (temporal
207 /// minutes) offset after sunset
208 #[must_use]
209 pub fn tzeis(&self, offset: &ZmanOffset) -> Option<Zoned> {
210 let use_elevation = self.use_elevation.to_bool(false);
211 zmanim_calculator::tzeis(&self.date, &self.geo_location, use_elevation, offset)
212 }
213
214 /// Returns *shaah zmanis* (temporal hour) according to the opinion of the
215 /// *Magen Avraham* (MGA) based on *alos* and *tzeis* being the given
216 /// offset from sunrise and sunset, respectively.
217 #[must_use]
218 pub fn shaah_zmanis_mga(&self, offset: &ZmanOffset) -> Option<SignedDuration> {
219 Some(zmanim_calculator::shaah_zmanis(
220 &self.alos(offset)?,
221 &self.tzeis(offset)?,
222 ))
223 }
224
225 // GRA
226 /// Returns the latest *zman shema* (time to recite *Shema* in the morning)
227 /// that is 3 *shaos zmaniyos* (solar hours) after
228 /// sunrise according the GRA. The day is
229 /// calculated from sunrise to sunset.
230 #[must_use]
231 pub fn sof_zman_shema_gra(&self) -> Option<Zoned> {
232 Some(zmanim_calculator::sof_zman_shema(
233 &self.zmanim_sunrise()?,
234 &self.zmanim_sunset()?,
235 ))
236 }
237
238 /// Returns the latest *zman tefila* (time to recite *shacharis* in the
239 /// morning) that is 4 *shaos zmaniyos* (solar hours) after
240 /// sunrise according GRA.
241 /// The day is calculated from sunrise to sunset
242 #[must_use]
243 pub fn sof_zman_tefila_gra(&self) -> Option<Zoned> {
244 Some(zmanim_calculator::sof_zman_tefila(
245 &self.zmanim_sunrise()?,
246 &self.zmanim_sunset()?,
247 ))
248 }
249
250 /// Returns the latest time for burning *chametz* on *Erev
251 /// Pesach* according to the opinion of the GRA. This time is 5 hours into
252 /// the day based on the opinion of the GRA that the day is calculated from
253 /// sunrise to sunset. Since this library does not implement a calendar,
254 /// this method will return the *zman* any day of the year.
255 #[must_use]
256 pub fn sof_zman_biur_chametz_gra(&self) -> Option<Zoned> {
257 Some(self.zmanim_sunrise()? + (self.shaah_zmanis_gra()? * 5))
258 }
259
260 /// Returns *mincha gedola* calculated as 6.5 * *shaos zmaniyos*
261 /// (solar hours) after sunrise, according to the GRA.
262 #[must_use]
263 pub fn mincha_gedola_gra(&self) -> Option<Zoned> {
264 Some(zmanim_calculator::mincha_gedola(
265 &self.zmanim_sunrise()?,
266 &self.zmanim_sunset()?,
267 ))
268 }
269
270 /// Returns the later of
271 /// [`mincha_gedola_gra`](ComplexZmanimCalendar::mincha_gedola_gra)
272 /// and
273 /// [`mincha_gedola_30_minutes`](ComplexZmanimCalendar::mincha_gedola_30_minutes)
274 /// . In the winter when 1/2 of a
275 /// [GRA *shaah zmanis*](ComplexZmanimCalendar::shaah_zmanis_gra)
276 /// is less than 30 minutes
277 /// [`mincha_gedola_30_minutes`](ComplexZmanimCalendar::mincha_gedola_30_minutes)
278 /// will be returned, otherwise
279 /// [`mincha_gedola_gra`](ComplexZmanimCalendar::mincha_gedola_gra)
280 /// will be returned
281 #[must_use]
282 pub fn mincha_gedola_gra_greater_than_30_minutes(&self) -> Option<Zoned> {
283 let mg_30 = self.mincha_gedola_30_minutes()?;
284 let mg_gra = self.mincha_gedola_gra()?;
285 Some(if mg_30 > mg_gra { mg_30 } else { mg_gra })
286 }
287
288 /// A method for calculating *samuch lemincha ketana*, / near *mincha
289 /// ketana* time that is half an hour before [*mincha
290 /// ketana*](ComplexZmanimCalendar::mincha_ketana_gra) or is 9 *shaos
291 /// zmaniyos* (solar hours) after sunrise, calculated according to the GRA
292 /// using a day starting at sunrise and ending at sunset. This is the
293 /// time that eating or other activity can't begin prior to praying
294 /// *mincha*. See the *Mechaber* and *Mishna Berurah* 232 and 249:2.
295 #[must_use]
296 pub fn samuch_lemincha_ketana_gra(&self) -> Option<Zoned> {
297 Some(self.zmanim_sunrise()? + (self.shaah_zmanis_gra()? * 9))
298 }
299
300 /// Returns *mincha ketana* calculated as 9.5 * *shaos zmaniyos*
301 /// (solar hours) after sunrise, according to the GRA.
302 #[must_use]
303 pub fn mincha_ketana_gra(&self) -> Option<Zoned> {
304 Some(zmanim_calculator::mincha_ketana(
305 &self.zmanim_sunrise()?,
306 &self.zmanim_sunset()?,
307 ))
308 }
309
310 /// Returns *plag hamincha* calculated as 10.75 * *shaos zmaniyos*
311 /// (solar hours) after sunrise, according to the GRA.
312 #[must_use]
313 pub fn plag_gra(&self) -> Option<Zoned> {
314 Some(zmanim_calculator::plag_hamincha(
315 &self.zmanim_sunrise()?,
316 &self.zmanim_sunset()?,
317 ))
318 }
319
320 /// Returns a *shaah zmanis* according to the opinion of the GRA.
321 /// This calculation divides the day based on the opinion of the *GRA* that
322 /// the day runs from from sunrise to sunset. The day is split into 12 equal
323 /// parts with each one being a *shaah zmanis*
324 #[must_use]
325 pub fn shaah_zmanis_gra(&self) -> Option<SignedDuration> {
326 Some(zmanim_calculator::shaah_zmanis(
327 &self.zmanim_sunrise()?,
328 &self.zmanim_sunset()?,
329 ))
330 }
331
332 // Baal HaTanya
333 /// Returns the *Baal Hatanya*'s *alos* (dawn) calculated as the time when
334 /// the sun is 16.9° below the eastern geometric horizon before sunrise.
335 /// It is based on the calculation that the time between dawn and
336 /// [*hanetz amiti*](ComplexZmanimCalendar::hanetz_amiti_baal_hatanya)
337 /// (sunrise) is 72 minutes, the time that is takes to walk 4 *mil* at
338 /// 18 minutes a *mil* (*Rambam* and others). The sun's position at 72
339 /// minutes before *hanetz amiti* (sunrise) in Jerusalem around the
340 /// equinox / equilux is 16.9° below geometric zenith.
341 #[must_use]
342 pub fn alos_baal_hatanya(&self) -> Option<Zoned> {
343 self.alos(&Degrees(16.9))
344 }
345
346 /// **Note: *hanetz amiti* is used only for
347 /// calculating certain other *zmanim*. For practical purposes, daytime
348 /// *mitzvos* like *shofar* and *lulav* should not be done until after the
349 /// normal time for [*hanetz*](ComplexZmanimCalendar::hanetz).**
350 ///
351 /// Returns the *Baal Hatanya*'s *hanetz amiti* (sunrise) without elevation
352 /// adjustment. This forms the base for the *Baal Hatanya*'s dawn-based
353 /// calculations that are calculated as a dip below the horizon before
354 /// sunrise. According to the *Baal Hatanya*, *hanetz amiti*, or true
355 /// (halachic) sunrise, is when the top of the sun's disk is visible at an
356 /// elevation similar to the mountains of *Eretz Yisrael*. The time is
357 /// calculated as the point at which the center of the sun's disk is
358 /// 1.583° below the horizon. This degree-based calculation can be found
359 /// in Rabbi Shalom DovBer Levine's commentary on The *Baal Hatanya*'s
360 /// *Seder Hachnasas Shabbos*. From an elevation of 546 meters, the top of
361 /// *Har Hacarmel*, the sun disappears when it is 1° 35' or 1.583°
362 /// below the sea level horizon. This in turn is based on the *Gemara
363 /// Shabbos* 35a. There are other opinions brought down by Rabbi Levine,
364 /// including Rabbi Yosef Yitzchok Feigelstock who calculates it as the
365 /// degrees below the horizon 4 minutes after sunset in *Yerushalayim* (on
366 /// the equinox). That is brought down as 1.583°. This is identical to
367 /// the 1° 35' *zman* and is probably a typo and should be 1.683°.
368 /// These calculations are used by most *Chabad* calendars that use the
369 /// *Baal Hatanya*'s *zmanim*.
370 #[must_use]
371 pub fn hanetz_amiti_baal_hatanya(&self) -> Option<Zoned> {
372 self.alos(&Degrees(1.583))
373 }
374
375 /// **Note: *shkiah amiti* is used only for calculating certain other
376 /// *zmanim*. For practical purposes, all daytime *mitzvos* should be
377 /// completed before the normal time for
378 /// [*shkiah*](ComplexZmanimCalendar::shkia).**
379 ///
380 /// Returns the *Baal Hatanya*'s *shkiah amiti* (sunset) without elevation
381 /// adjustment. This forms the base for the *Baal Hatanya*'s dusk-based
382 /// calculations that are calculated as a dip below the horizon after
383 /// sunset. According to the *Baal Hatanya*, *shkiah amiti*, true (halachic)
384 /// sunset, is when the top of the sun's disk disappears from view at an
385 /// elevation similar to the mountains of *Eretz Yisrael*. This time is
386 /// calculated as the point at which the center of the sun's disk is 1.583
387 /// degrees below the horizon.
388 #[must_use]
389 pub fn shkia_amiti_baal_hatanya(&self) -> Option<Zoned> {
390 self.tzeis(&Degrees(1.583))
391 }
392
393 /// Returns the *Baal Hatanya*'s a *shaah zmanis* (temporal hour). This
394 /// forms the base for the *Baal Hatanya*'s day based calculations that are
395 /// calculated as a 1.583° dip below the horizon after sunset. According
396 /// to the *Baal Hatanya*, *shkiah amiti*, true (halachic) sunset, is when
397 /// the top of the sun's disk disappears from view at an elevation similar
398 /// to the mountains of *Eretz Yisrael*. This time is calculated as the
399 /// point at which the center of the sun's disk is 1.583 degrees below the
400 /// horizon. The calculations are based on a day from [*hanetz
401 /// amiti*](ComplexZmanimCalendar::hanetz_amiti_baal_hatanya) to
402 /// [*shkiah amiti*](ComplexZmanimCalendar::shkia_amiti_baal_hatanya). The
403 /// day is split into 12 equal parts with each one being a *shaah
404 /// zmanis*.
405 #[must_use]
406 pub fn shaah_zmanis_baal_hatanya(&self) -> Option<SignedDuration> {
407 self.shaah_zmanis_mga(&Degrees(1.583))
408 }
409
410 /// Returns the the *Baal Hatanya*'s *sof *zman* krias shema*
411 /// (latest time to recite *Shema* in the morning). This time is 3
412 /// of the [*Baal Hatanya*'s temporal
413 /// hours](ComplexZmanimCalendar::shaah_zmanis_baal_hatanya) after [*hanetz
414 /// amiti*](ComplexZmanimCalendar::hanetz_amiti_baal_hatanya) (sunrise)
415 /// based on the opinion of the *Baal Hatanya* that the day is
416 /// calculated from sunrise to sunset.
417 #[must_use]
418 pub fn sof_zman_shema_baal_hatanya(&self) -> Option<Zoned> {
419 self.sof_zman_shema_mga(&Degrees(1.583))
420 }
421
422 /// Returns the the *Baal Hatanya*'s *sof *zman* tefila* (latest
423 /// time to recite the morning prayers). This time is 4 of the [*Baal
424 /// Hatanya*'s temporal
425 /// hours](ComplexZmanimCalendar::shaah_zmanis_baal_hatanya) after [*hanetz
426 /// amiti*](ComplexZmanimCalendar::hanetz_amiti_baal_hatanya) (sunrise)
427 /// based on the opinion of the *Baal Hatanya* that the day is
428 /// calculated from sunrise to sunset.
429 #[must_use]
430 pub fn sof_zman_tefila_baal_hatanya(&self) -> Option<Zoned> {
431 self.sof_zman_tefila_mga(&Degrees(1.583))
432 }
433
434 /// Returns the latest time for burning *chametz* on *Erev
435 /// Pesach* according to the opinion of the Baal Hatanya. This time is 5
436 /// of the [*Baal Hatanya*'s temporal
437 /// hours](ComplexZmanimCalendar::shaah_zmanis_baal_hatanya) after [*hanetz
438 /// amiti*](ComplexZmanimCalendar::hanetz_amiti_baal_hatanya) (sunrise)
439 /// based on the opinion of the *Baal Hatanya* that the day is
440 /// calculated from sunrise to sunset. Since this library does not
441 /// implement a calendar, this method will return the *zman* any day of
442 /// the year.
443 #[must_use]
444 pub fn sof_zman_biur_chametz_baal_hatanya(&self) -> Option<Zoned> {
445 self.sof_zman_biur_chametz_mga(&Degrees(1.583))
446 }
447
448 /// Returns the the *Baal Hatanya*'s *mincha gedola*. *Mincha
449 /// gedola* is the earliest time one can pray *mincha*. The *Rambam* is
450 /// of the opinion that it is better to delay *mincha* until *mincha
451 /// ketana* while the *Rash*, *Tur*, GRA and others are of the opinion
452 /// that *mincha* can be prayed *lechatchila* starting at *mincha
453 /// gedola*. This is calculated as 6.5 of the [*Baal Hatanya*'s temporal
454 /// hours](ComplexZmanimCalendar::shaah_zmanis_baal_hatanya) after [*hanetz
455 /// amiti*](ComplexZmanimCalendar::hanetz_amiti_baal_hatanya) (sunrise).
456 /// This calculation is based on the opinion of the *Baal Hatanya* that
457 /// the day is calculated from sunrise to sunset.
458 #[must_use]
459 pub fn mincha_gedola_baal_hatanya(&self) -> Option<Zoned> {
460 self.mincha_gedola_mga(&Degrees(1.583))
461 }
462
463 /// Returns the later of
464 /// [`mincha_gedola_baal_hatanya`](ComplexZmanimCalendar::mincha_gedola_baal_hatanya)
465 /// and
466 /// [`mincha_gedola_30_minutes`](ComplexZmanimCalendar::mincha_gedola_30_minutes)
467 /// . In the winter when 1/2 of a
468 /// [*Baal Hatanya shaah
469 /// zmanis*](ComplexZmanimCalendar::shaah_zmanis_baal_hatanya)
470 /// is less than 30 minutes
471 /// [`mincha_gedola_30_minutes`](ComplexZmanimCalendar::mincha_gedola_30_minutes)
472 /// will be returned, otherwise
473 /// [`mincha_gedola_baal_hatanya`](ComplexZmanimCalendar::mincha_gedola_baal_hatanya)
474 /// will be returned
475 #[must_use]
476 pub fn mincha_gedola_baal_hatanya_greater_than_30_minutes(&self) -> Option<Zoned> {
477 let mg_30 = self.mincha_gedola_30_minutes()?;
478 let mg_bht = self.mincha_gedola_baal_hatanya()?;
479 Some(if mg_30 > mg_bht { mg_30 } else { mg_bht })
480 }
481
482 /// Returns the *Baal Hatanya*'s *mincha ketana*. This is the
483 /// preferred earliest time to pray *mincha* in the opinion of the *Rambam*
484 /// and others. For more information on this see the documentation on
485 /// *mincha gedola*. This is calculated as 9.5 of the [*Baal Hatanya*'s
486 /// temporal hours](ComplexZmanimCalendar::shaah_zmanis_baal_hatanya) after
487 /// [*hanetz amiti*](ComplexZmanimCalendar::hanetz_amiti_baal_hatanya)
488 /// (sunrise). This calculation is calculated based on the opinion of
489 /// the *Baal Hatanya* that the day is calculated from sunrise to
490 /// sunset.
491 #[must_use]
492 pub fn mincha_ketana_baal_hatanya(&self) -> Option<Zoned> {
493 self.mincha_ketana_mga(&Degrees(1.583))
494 }
495
496 /// Returns the *Baal Hatanya*'s *plag hamincha*. This is
497 /// calculated as 10.75 of the [*Baal Hatanya*'s temporal
498 /// hours](ComplexZmanimCalendar::shaah_zmanis_baal_hatanya) after *hanetz
499 /// amiti* (sunrise). This calculation is calculated based on the
500 /// opinion of the *Baal Hatanya* that the day is calculated from
501 /// sunrise to sunset.
502 #[must_use]
503 pub fn plag_baal_hatanya(&self) -> Option<Zoned> {
504 self.plag_mga(&Degrees(1.583))
505 }
506
507 /// Returns *tzeis* (nightfall) when the sun is 6° below
508 /// the western geometric horizon (90°) after sunset. This calculation
509 /// is based on the position of the sun 24 minutes after sunset in Jerusalem
510 /// around the equinox / equilux, which is 6° below geometric zenith.
511 #[must_use]
512 pub fn tzeis_baal_hatanya(&self) -> Option<Zoned> {
513 self.tzeis(&Degrees(6.0))
514 }
515
516 // Rav Moshe Feinstein
517 /// Returns fixed local *chatzos*. See
518 /// [`zmanim_calculator::fixed_local_chatzos`] for more details
519 #[must_use]
520 pub fn fixed_local_chatzos(&self) -> Option<Zoned> {
521 zmanim_calculator::fixed_local_chatzos(&self.date, &self.geo_location)
522 }
523
524 /// Returns Rav Moshe Feinstein's opinion of the calculation of
525 /// *sof zman krias shema* (latest time to recite *Shema* in the morning)
526 /// according to the opinion of the *Magen Avraham* (MGA) that the day is
527 /// calculated from dawn to nightfall, but calculated using the first half
528 /// of the day only. The half a day starts at *alos* defined as 18° and
529 /// ends at fixed local *chatzos*. *Sof Zman Shema* is 3 *shaos
530 /// zmaniyos* (solar hours) after *alos* or half of this half-day.
531 #[must_use]
532 pub fn sof_zman_shema_mga_18_degrees_to_fixed_local_chatzos(&self) -> Option<Zoned> {
533 let alos = self.alos_18_degrees()?;
534 let chatzos = self.fixed_local_chatzos()?;
535 alos.checked_add(chatzos.duration_since(&alos) / 2).ok()
536 }
537
538 /// Returns Rav Moshe Feinstein's opinion of the calculation of
539 /// *sof zman krias shema* (latest time to recite *Shema* in the morning)
540 /// according to the opinion of the *Magen Avraham* (MGA) that the day is
541 /// calculated from dawn to nightfall, but calculated using the first half
542 /// of the day only. The half a day starts at *alos* defined as 16.1°
543 /// and ends at fixed local *chatzos*. *Sof Zman Shema* is 3 *shaos
544 /// zmaniyos* (solar hours) after this *alos* or half of this half-day.
545 #[must_use]
546 pub fn sof_zman_shema_mga_16_1_degrees_to_fixed_local_chatzos(&self) -> Option<Zoned> {
547 let alos = self.alos_16_1_degrees()?;
548 let chatzos = self.fixed_local_chatzos()?;
549 alos.checked_add(chatzos.duration_since(&alos) / 2).ok()
550 }
551
552 /// Returns Rav Moshe Feinstein's opinion of the calculation of
553 /// *sof zman krias shema* (latest time to recite *Shema* in the morning)
554 /// according to the opinion of the *Magen Avraham* (MGA) that the day is
555 /// calculated from dawn to nightfall, but calculated using the first half
556 /// of the day only. The half a day starts at *alos* defined as 90 minutes
557 /// before sunrise and ends at fixed local *chatzos*. *Sof Zman Shema* is 3
558 /// *shaos zmaniyos* (solar hours) after this *alos* or half of this
559 /// half-day.
560 #[must_use]
561 pub fn sof_zman_shema_mga_90_minutes_to_fixed_local_chatzos(&self) -> Option<Zoned> {
562 let alos = self.alos_90_minutes()?;
563 let chatzos = self.fixed_local_chatzos()?;
564 alos.checked_add(chatzos.duration_since(&alos) / 2).ok()
565 }
566
567 /// Returns Rav Moshe Feinstein's opinion of the calculation of
568 /// *sof zman krias shema* (latest time to recite *Shema* in the morning)
569 /// according to the opinion of the *Magen Avraham* (MGA) that the day is
570 /// calculated from dawn to nightfall, but calculated using the first half
571 /// of the day only. The half a day starts at *alos* defined as 72 minutes
572 /// before sunrise and ends at fixed local *chatzos*. *Sof Zman Shema* is 3
573 /// *shaos zmaniyos* (solar hours) after this *alos* or half of this
574 /// half-day.
575 #[must_use]
576 pub fn sof_zman_shema_mga_72_minutes_to_fixed_local_chatzos(&self) -> Option<Zoned> {
577 let alos = self.alos_72_minutes()?;
578 let chatzos = self.fixed_local_chatzos()?;
579 alos.checked_add(chatzos.duration_since(&alos) / 2).ok()
580 }
581
582 /// Returns Rav Moshe Feinstein's opinion of the calculation of
583 /// *sof zman krias shema* (latest time to recite *Shema* in the morning)
584 /// according to the opinion of the GRA that the day is calculated from
585 /// sunrise to sunset, but calculated using the first half of the day only.
586 /// The half a day starts at sunrise and ends at fixed local *chatzos*. *Sof
587 /// zman Shema* is 3 *shaos zmaniyos* (solar hours) after sunrise or half of
588 /// this half-day.
589 #[must_use]
590 pub fn sof_zman_shema_gra_sunrise_to_fixed_local_chatzos(&self) -> Option<Zoned> {
591 let alos = self.zmanim_sunrise()?;
592 let chatzos = self.fixed_local_chatzos()?;
593 alos.checked_add(chatzos.duration_since(&alos) / 2).ok()
594 }
595
596 /// Returns Rav Moshe Feinstein's opinion of the calculation of
597 /// *sof zman tefila* (the latest time to recite the morning
598 /// prayers) according to the opinion of the GRA that the day is calculated
599 /// from sunrise to sunset, but calculated using the first half of the day
600 /// only. The half a day starts at sunrise and ends at fixed local
601 /// *chatzos*. *Sof zman tefila* is 4 *shaos zmaniyos* (solar hours) after
602 /// sunrise or 2/3 of this half-day.
603 #[must_use]
604 pub fn sof_zman_tefila_gra_sunrise_to_fixed_local_chatzos(&self) -> Option<Zoned> {
605 let alos = self.zmanim_sunrise()?;
606 let chatzos = self.fixed_local_chatzos()?;
607 alos.checked_add(chatzos.duration_since(&alos) * 2 / 3).ok()
608 }
609
610 /// Returns Rav Moshe Feinstein's opinion of the calculation of
611 /// mincha gedola, the earliest time one can pray mincha that is 30 minutes
612 /// after fixed local *chatzos*.
613 #[must_use]
614 pub fn mincha_gedola_gra_fixed_local_chatzos_30_minutes(&self) -> Option<Zoned> {
615 self.fixed_local_chatzos()?
616 .checked_add(SignedDuration::from_mins(30))
617 .ok()
618 }
619
620 /// Returns Rav Moshe Feinstein's opinion of the calculation of
621 /// mincha ketana (the preferred time to recite the mincha prayers according
622 /// to the opinion of the Rambam and others) calculated according to the GRA
623 /// that is 3.5 *shaos zmaniyos* (solar hours) after fixed local *chatzos*.
624 #[must_use]
625 pub fn mincha_ketana_gra_fixed_local_chatzos_to_sunset(&self) -> Option<Zoned> {
626 let chatzos = self.fixed_local_chatzos()?;
627 let sunset = self.zmanim_sunset()?;
628 chatzos
629 .checked_add(sunset.duration_since(&chatzos) / 12 * 7)
630 .ok()
631 }
632
633 /// Returns Rav Moshe Feinstein's opinion of the calculation of
634 /// plag hamincha. This method returns plag hamincha calculated according to
635 /// the GRA that the day ends at sunset and is 4.75 *shaos zmaniyos* (solar
636 /// hours) after fixed local *chatzos*.
637 #[must_use]
638 pub fn plag_gra_fixed_local_chatzos_to_sunset(&self) -> Option<Zoned> {
639 let chatzos = self.fixed_local_chatzos()?;
640 let sunset = self.zmanim_sunset()?;
641 chatzos
642 .checked_add(sunset.duration_since(&chatzos) / 24 * 19)
643 .ok()
644 }
645
646 /// Method to return *tzeis* (dusk) calculated as 50 minutes after
647 /// sunset. This method returns
648 /// *tzeis* (nightfall) based on the opinion of Rabbi Moshe Feinstein
649 /// for the New York area. This time should not be used for latitudes
650 /// other than ones similar to the latitude of the NY area.
651 #[must_use]
652 pub fn tzeis_50_minutes(&self) -> Option<Zoned> {
653 self.tzeis(&Minutes(50.0))
654 }
655
656 // Ahavat Shalom
657 /// Returns the time of *mincha gedola* based on the opinion of
658 /// Rabbi Yaakov Moshe Hillel as published in the luach of the Beis Horaah
659 /// of Yeshivat Chevrat Ahavat Shalom that *mincha gedola* is calculated as
660 /// half a *shaah zmanis* after *chatzos* with *shaos zmaniyos* calculated
661 /// based on a day starting 72 minutes before sunrise (alos 16.1°) and
662 /// ending 13.5 minutes after sunset (*tzeis* 3.7°). *Mincha gedola* is
663 /// the earliest time to pray *mincha*. The later of this time or 30
664 /// clock minutes after *chatzos* is returned. See
665 /// [`mincha_gedola_gra_greater_than_30_minutes`](ComplexZmanimCalendar::mincha_gedola_gra_greater_than_30_minutes)
666 /// (though that calculation is based on *mincha gedola* GRA). For more
667 /// information about *mincha gedola* see the documentation on [*mincha
668 /// gedola*](zmanim_calculator::mincha_gedola).
669 #[must_use]
670 pub fn mincha_gedola_ahavat_shalom(&self) -> Option<Zoned> {
671 let chatzos = self.chatzos()?;
672 let alos_16_1 = self.alos_16_1_degrees()?;
673 let tzeis_3_7 = self.tzeis_geonim_3_7_degrees()?;
674 // let shaah =
675 // self.shaah_zmanis_alos_16_1_to_tzeis_3_7()?.to_duration(relative);
676 let mg_as = chatzos
677 .checked_add(tzeis_3_7.duration_since(&alos_16_1) / 24)
678 .ok()?;
679 let mg_30 = self.mincha_gedola_30_minutes()?;
680 Some(if mg_30 > mg_as { mg_30 } else { mg_as })
681 }
682
683 /// Returns the time of *mincha ketana* based on the opinion of
684 /// Rabbi Yaakov Moshe Hillel as published in the luach of the Beis Horaah
685 /// of Yeshivat Chevrat Ahavat Shalom that *mincha ketana* is calculated as
686 /// 2.5 *shaos zmaniyos* before *tzeis* 3.8° with *shaos zmaniyos*
687 /// calculated based on a day starting at *alos* 16.1° and ending at
688 /// *tzeis* 3.8°. *Mincha ketana* is the preferred earliest time to
689 /// pray *mincha* according to the opinion of the *Rambam* and others.
690 /// For more information on this see the documentation on [*mincha
691 /// gedola*](zmanim_calculator::mincha_gedola).
692 #[must_use]
693 pub fn mincha_ketana_ahavat_shalom(&self) -> Option<Zoned> {
694 Some(zmanim_calculator::mincha_ketana(
695 &self.alos_16_1_degrees()?,
696 &self.tzeis_geonim_3_8_degrees()?,
697 ))
698 }
699
700 /// Returns the time of *plag hamincha* based on the opinion of
701 /// Rabbi Yaakov Moshe Hillel as published in the luach of the Beis Horaah
702 /// of Yeshivat Chevrat Ahavat Shalom that that *plag hamincha* is
703 /// calculated as 1.25 *shaos zmaniyos* before *tzeis* 3.8° with *shaos
704 /// zmaniyos* calculated based on a day starting at *alos* 16.1° and
705 /// ending at *tzeis* 3.8°.
706 #[must_use]
707 pub fn plag_ahavat_shalom(&self) -> Option<Zoned> {
708 Some(zmanim_calculator::plag_hamincha(
709 &self.alos_16_1_degrees()?,
710 &self.tzeis_geonim_3_8_degrees()?,
711 ))
712 }
713
714 /// Returns a *shaah zmanis* (temporal hour) used by some *zmanim*
715 /// according to the opinion of Rabbi Yaakov Moshe Hillel as published in
716 /// the luach of the Beis Horaah of Yeshivat Chevrat Ahavat Shalom that is
717 /// based on a day starting 72 minutes before sunrise in degrees (*alos*
718 /// 16.1°) and ending 14 minutes after sunset in degrees (*tzeis*
719 /// 3.8°). This day is split into 12 equal parts with each part
720 /// being a *shaah zmanis*. Note that with this system, *chatzos*
721 /// (midday) will not be the point that the sun is halfway across the
722 /// sky. These *shaos zmaniyos* are used for *Mincha Ketana* and *Plag
723 /// Hamincha*. The 14 minutes are based on 3/4 of an 18 minute *mil*,
724 /// with half a minute added for Rav Yosi.
725 #[must_use]
726 pub fn shaah_zmanis_alos_16_1_to_tzeis_3_8(&self) -> Option<SignedDuration> {
727 Some(zmanim_calculator::shaah_zmanis(
728 &self.alos_16_1_degrees()?,
729 &self.tzeis_geonim_3_8_degrees()?,
730 ))
731 }
732
733 /// Returns a *shaah zmanis* (temporal hour) used by some *zmanim*
734 /// according to the opinion of Rabbi Yaakov Moshe Hillel as published in
735 /// the luach of the Beis Horaah of Yeshivat Chevrat Ahavat Shalom that is
736 /// based on a day starting 72 minutes before sunrise in degrees (*alos*
737 /// 16.1°) and ending 13.5 minutes after sunset in degrees (*tzeis*
738 /// 3.7°). This day is split into 12 equal parts with each part
739 /// being a *shaah zmanis*. Note that with this system, *chatzos*
740 /// (midday) will not be the point that the sun is halfway across the
741 /// sky. These *shaos zmaniyos* are used for *mincha gedola* calculation.
742 #[must_use]
743 pub fn shaah_zmanis_alos_16_1_to_tzeis_3_7(&self) -> Option<SignedDuration> {
744 Some(zmanim_calculator::shaah_zmanis(
745 &self.alos_16_1_degrees()?,
746 &self.tzeis_geonim_3_7_degrees()?,
747 ))
748 }
749
750 // Ateret Torah
751 /// Returns the latest *zman krias shema* (time to recite
752 /// *Shema* in the morning) based on the calculation of *Chacham* Yosef
753 /// Harari-Raful of Yeshivat Ateret Torah, that the day starts 1/10th of the
754 /// day before sunrise and is usually calculated as ending 40 minutes after
755 /// sunset. *Shaos zmaniyos* are calculated based on this day and added to
756 /// *alos*to reach this time. This time is 3 *shaos zmaniyos* (temporal
757 /// hours) after *alos*72 zmaniyos. Note: Based on this calculation
758 /// *chatzos* will not be at midday.
759 #[must_use]
760 pub fn sof_zman_shema_ateret_torah(&self) -> Option<Zoned> {
761 Some(zmanim_calculator::sof_zman_shema(
762 &self.alos_72_minutes_zmanis()?,
763 &self.tzeis_ateret_torah()?,
764 ))
765 }
766
767 /// Returns the latest *zman tefila* (time to recite the morning
768 /// prayers) based on the calculation of *Chacham* Yosef Harari-Raful of
769 /// Yeshivat Ateret Torah, that the day starts 1/10th of the day before
770 /// sunrise and is usually calculated as ending 40 minutes after sunset.
771 /// *Shaos zmaniyos* are calculated based on this day and added to *alos*to
772 /// reach this time. This time is 4 * *shaos zmaniyos* (temporal hours)
773 /// after *alos*72 *zmaniyos*. Note: Based on this calculation *chatzos*
774 /// will not be at midday.
775 #[must_use]
776 pub fn sof_zman_tefila_ateret_torah(&self) -> Option<Zoned> {
777 Some(zmanim_calculator::sof_zman_tefila(
778 &self.alos_72_minutes_zmanis()?,
779 &self.tzeis_ateret_torah()?,
780 ))
781 }
782
783 /// Returns the time of *mincha gedola* based on the calculation of
784 /// *Chacham* Yosef Harari-Raful of Yeshivat Ateret Torah, that the day
785 /// starts 1/10th of the day before sunrise and is usually calculated as
786 /// ending 40 minutes after sunset. The *Rambam* is of the opinion that it
787 /// is better to delay *mincha* until *mincha ketana* while the Ra"sh, Tur,
788 /// GRA and others are of the opinion that mincha can be prayed lechatchila
789 /// starting at mincha gedola. For more information on this see the
790 /// documentation on [*mincha gedola*](zmanim_calculator::mincha_gedola).
791 /// This is calculated as 6.5 solar hours after *alos*. The calculation used
792 /// is 6.5 * [`ComplexZmanimCalendar::shaah_zmanis_ateret_torah`] after
793 /// *alos*.
794 #[must_use]
795 pub fn mincha_gedola_ateret_torah(&self) -> Option<Zoned> {
796 Some(zmanim_calculator::mincha_gedola(
797 &self.alos_72_minutes_zmanis()?,
798 &self.tzeis_ateret_torah()?,
799 ))
800 }
801
802 /// Returns the time of *mincha ketana* based on the calculation of
803 /// *Chacham* Yosef Harari-Raful of Yeshivat Ateret Torah, that the day
804 /// starts 1/10th of the day before sunrise and is usually calculated as
805 /// ending 40 minutes after sunset. This is the preferred earliest time to
806 /// pray *mincha* according to the opinion of the *Rambam* and others. For
807 /// more information on this see the documentation on [*mincha
808 /// ketana*](zmanim_calculator::mincha_ketana). This is calculated as 9.5
809 /// solar hours after *alos*. The calculation used is 9.5 *
810 /// [`ComplexZmanimCalendar::shaah_zmanis_ateret_torah`] after *alos*.
811 #[must_use]
812 pub fn mincha_ketana_ateret_torah(&self) -> Option<Zoned> {
813 Some(zmanim_calculator::mincha_ketana(
814 &self.alos_72_minutes_zmanis()?,
815 &self.tzeis_ateret_torah()?,
816 ))
817 }
818
819 /// Returns the time of *plag hamincha* based on the calculation
820 /// of *Chacham* Yosef Harari-Raful of Yeshivat Ateret Torah, that the day
821 /// starts 1/10th of the day before sunrise and is usually calculated as
822 /// ending 40 minutes after sunset. *Shaos zmaniyos* are calculated based on
823 /// this day and added to *alos* to reach this time. This time is 10.75
824 /// *shaos zmaniyos* (temporal hours) after dawn.
825 #[must_use]
826 pub fn plag_ateret_torah(&self) -> Option<Zoned> {
827 Some(zmanim_calculator::plag_hamincha(
828 &self.alos_72_minutes_zmanis()?,
829 &self.tzeis_ateret_torah()?,
830 ))
831 }
832
833 /// Returns *tzeis* calculated as 40 minutes after sunset. Please note that
834 /// *Chacham* Yosef Harari-Raful of Yeshivat Ateret Torah who uses this
835 /// time, does so only for calculating various other zmanei hayom such as
836 /// *Sof Zman Krias Shema* and *Plag Hamincha*. His calendars do not publish
837 /// a *zman* for *tzeis*. It should also be noted that *Chacham*
838 /// Harari-Raful provided a 25 minute *zman* for Israel. This API uses
839 /// 40 minutes year round in any place on the globe.
840 #[must_use]
841 pub fn tzeis_ateret_torah(&self) -> Option<Zoned> {
842 self.tzeis(&Minutes(40.0))
843 }
844
845 /// Returns a shaah zmanis (temporal hour) according to the opinion
846 /// of the *Chacham* Yosef Harari-Raful of Yeshivat Ateret Torah calculated
847 /// with *alos* being 1/10th of sunrise to sunset day, or 72 minutes
848 /// *zmaniyos* of such a day before sunrise, and *tzeis* is usually
849 /// calculated as 40 minutes after sunset. This day is split into 12
850 /// equal parts with each part being a shaah zmanis. Note that with this
851 /// system, *chatzos* (midday) will not be the point that the sun is
852 /// halfway across the sky.
853 #[must_use]
854 pub fn shaah_zmanis_ateret_torah(&self) -> Option<SignedDuration> {
855 Some(zmanim_calculator::shaah_zmanis(
856 &self.alos_72_minutes_zmanis()?,
857 &self.tzeis_ateret_torah()?,
858 ))
859 }
860
861 // Shach
862 /// Returns the latest *zman krias shema* (time to recite *Shema* in the
863 /// morning) calculated as 3 hours (regular clock hours and not *shaos
864 /// zmaniyos*) before *chatzos*. Generally known as part of the "Komarno"
865 /// *zmanim* after Rav Yitzchak Eizik of Komarno, a proponent of this
866 /// calculation, it actually predates him a lot. It is the opinion of the
867 /// *Shach* in the *Nekudas Hakesef* (*Yoreh Deah* 184), Rav Moshe Lifshitz
868 /// in his commentary *Lechem Mishneh* on *Brachos* 1:2. It is next brought
869 /// down about 100 years later by the *Yaavetz* (in his *siddur*, *Mor
870 /// Uktziah Orach Chaim* 1, *Lechem Shamayim*, *Brachos* 1:2 and *She'elos
871 /// Yaavetz* vol. 1 no. 40), Rav Yitzchak Eizik of Komarno in the *Ma'aseh
872 /// Oreg* on *Mishnayos Brachos* 11:2, *Shevus Yaakov*, *Chasan Sofer* and
873 /// others. See *Yisrael Vehazmanim* vol. 1 7:3, page 55 - 62
874 #[must_use]
875 pub fn sof_zman_shema_3_hrs_before_chatzos(&self) -> Option<Zoned> {
876 self.chatzos()?
877 .checked_sub(SignedDuration::from_hours(3))
878 .ok()
879 }
880
881 /// Returns the latest *zman* tefila (time to recite the morning prayers)
882 /// calculated as 2 hours before *chatzos*. This is based on the opinions
883 /// that calculate sof *zman* krias shema as [3 hours before
884 /// *chatzos*](ComplexZmanimCalendar::sof_zman_shema_3_hrs_before_chatzos).
885 #[must_use]
886 pub fn sof_zman_tefila_2_hrs_before_chatzos(&self) -> Option<Zoned> {
887 self.chatzos()?
888 .checked_sub(SignedDuration::from_hours(2))
889 .ok()
890 }
891
892 zmanim_for_offset!(
893 |_| Some(Degrees(16.1)),
894 [
895 alos_16_1_degrees => alos, alos_degrees_basedon_doc!(16.1, 72),
896 tzeis_16_1_degrees => tzeis, tzeis_degrees_basedon_doc!(16.1, 72),
897 shaah_zmanis_mga_16_1_degrees => shaah_zmanis_mga, shaah_mga_degrees_basedon_doc!(16.1, 72),
898 sof_zman_shema_mga_16_1_degrees => sof_zman_shema_mga, szks_mga_degrees_doc!(16.1),
899 sof_zman_tefila_mga_16_1_degrees => sof_zman_tefila_mga, szt_mga_degrees_doc!(16.1),
900 sof_zman_biur_chametz_mga_16_1_degrees => sof_zman_biur_chametz_mga, sz_biur_chametz_mga_degrees_doc!(16.1),
901 mincha_gedola_mga_16_1_degrees => mincha_gedola_mga, mg_mga_degrees_doc!(16.1),
902 samuch_lemincha_ketana_mga_16_1_degrees => samuch_lemincha_ketana_mga, slmk_mga_degrees_doc!(16.1),
903 mincha_ketana_mga_16_1_degrees => mincha_ketana_mga, mk_mga_degrees_doc!(16.1),
904 plag_mga_16_1_degrees => plag_mga, plag_mga_degrees_lechumra_doc!(16.1),
905 ]
906 );
907
908 // *alos* 16.1 degrees to sunset
909 /// Returns the latest *zman krias shema* (time to recite
910 /// *Shema* in the morning) based on the opinion that the day starts at
911 /// *alos* 16.1° and ends at sea level sunset (no adjustment for
912 /// elevation is made). This is the opinion of the *Chidushei UKlalos
913 /// HaRazah* and the *Menora Hatehora* as mentioned by *Yisrael
914 /// Vehazmanim* vol 1, sec. 7, ch. 3 no. 16. Three *shaos zmaniyos* are
915 /// calculated based on this day and added to *alos* to reach this time.
916 /// This time is 3 *shaos zmaniyos* (solar hours) after dawn based on
917 /// the opinion that the day is calculated from a *alos* 16.1° to
918 /// sea level sunset.
919 #[must_use]
920 pub fn sof_zman_shema_alos_16_1_degrees_to_sunset(&self) -> Option<Zoned> {
921 Some(zmanim_calculator::sof_zman_shema(
922 &self.alos_16_1_degrees()?,
923 &self.zmanim_sunset()?,
924 ))
925 }
926
927 // seems like this method was removed from KJ
928 /// This method should be used *lechumra* only and returns the time of *plag
929 /// hamincha* based on the opinion that the day starts at *alos* 16.1°
930 /// and ends at sunset.
931 ///
932 /// 10.75 *shaos zmaniyos* are calculated based on
933 /// this day and added to *alos*to reach this time. This time is 10.75
934 /// *shaos zmaniyos* (temporal hours) after dawn based on the opinion
935 /// that the day is calculated from a dawn of 16.1 degrees before
936 /// sunrise to sunset. This returns the time of 10.75 * the calculated
937 /// *shaah zmanis* after dawn. Since plag by this calculation can occur
938 /// after sunset, it should only be used *lechumra*.
939 #[must_use]
940 pub fn plag_alos_16_1_degrees_to_sunset(&self) -> Option<Zoned> {
941 Some(zmanim_calculator::plag_hamincha(
942 &self.alos_16_1_degrees()?,
943 &self.zmanim_sunset()?,
944 ))
945 }
946
947 // 16.1 degrees to *tzeis* geonim 7.083 degrees
948 /// Returns the latest *zman krias shema* (time to recite
949 /// *Shema* in the morning) based on the opinion that the day starts at
950 /// *alos* 16.1° and ends at *tzeis* 7.083°. 3 *shaos zmaniyos*
951 /// are calculated based on this day and added to *alos*to reach this
952 /// time. This time is 3 *shaos zmaniyos* (temporal hours) after alos
953 /// 16.1° based on the opinion that the day is calculated from a
954 /// *alos* 16.1° to *tzeis* 7.083°.
955 #[must_use]
956 pub fn sof_zman_shema_alos_16_1_degrees_to_tzeis_geonim_7_083_degrees(&self) -> Option<Zoned> {
957 Some(zmanim_calculator::sof_zman_shema(
958 &self.alos_16_1_degrees()?,
959 &self.tzeis_geonim_7_083_degrees()?,
960 ))
961 }
962
963 /// Returns the time of *plag hamincha* based on the opinion
964 /// that the day starts at *alos* 16.1° and ends at *tzeis*
965 /// 7.083°. 10.75 *shaos zmaniyos* are calculated based on this day
966 /// and added to *alos* to reach this time. This time is 10.75 *shaos
967 /// zmaniyos* (temporal hours) after dawn based on the opinion that the
968 /// day is calculated from a dawn of 16.1 degrees before sunrise to
969 /// *tzeis* 7.083°. This returns the time of 10.75 * the calculated
970 /// *shaah zmanis* after dawn.
971 #[must_use]
972 pub fn plag_alos_16_1_degrees_to_tzeis_geonim_7_083_degrees(&self) -> Option<Zoned> {
973 Some(zmanim_calculator::plag_hamincha(
974 &self.alos_16_1_degrees()?,
975 &self.tzeis_geonim_7_083_degrees()?,
976 ))
977 }
978
979 zmanim_for_offset!(
980 |_| Some(Degrees(18.0)),
981 [
982 alos_18_degrees => alos, alos_degrees_doc!(18),
983 tzeis_18_degrees => tzeis, tzeis_degrees_doc!(18),
984 shaah_zmanis_mga_18_degrees => shaah_zmanis_mga, shaah_mga_degrees_doc!(18),
985 sof_zman_shema_mga_18_degrees => sof_zman_shema_mga, szks_mga_degrees_doc!(18),
986 sof_zman_tefila_mga_18_degrees => sof_zman_tefila_mga, szt_mga_degrees_doc!(18),
987 plag_mga_18_degrees => plag_mga, plag_mga_degrees_lechumra_doc!(18),
988 ]
989 );
990
991 // 19 degrees
992 /// Returns *alos* (dawn) calculated when the sun is 19°
993 /// below the eastern geometric horizon before sunrise. This is the
994 /// *Rambam*'s *alos* according to Rabbi Moshe Kosower's *Maaglei Tzedek*,
995 /// page 88, *Ayeles Hashachar* Vol. I, page 12, *Yom Valayla Shel Torah*,
996 /// Ch. 34, p. 222 and Rabbi Yaakov Shakow's *Luach Ikvei Hayom*.
997 #[must_use]
998 pub fn alos_19_degrees(&self) -> Option<Zoned> {
999 self.alos(&Degrees(19.0))
1000 }
1001
1002 zmanim_for_offset!(
1003 |_| Some(Degrees(19.8)),
1004 [
1005 alos_19_8_degrees => alos, alos_degrees_basedon_doc!(19.8, 90),
1006 tzeis_19_8_degrees => tzeis, tzeis_degrees_basedon_doc!(19.8, 90),
1007 shaah_zmanis_mga_19_8_degrees => shaah_zmanis_mga, shaah_mga_degrees_basedon_doc!(19.8, 90),
1008 sof_zman_shema_mga_19_8_degrees => sof_zman_shema_mga, szks_mga_degrees_doc!(19.8),
1009 sof_zman_tefila_mga_19_8_degrees => sof_zman_tefila_mga, szt_mga_degrees_doc!(19.8),
1010 plag_mga_19_8_degrees => plag_mga, plag_mga_degrees_lechumra_doc!(19.8),
1011 ]
1012 );
1013
1014 zmanim_for_offset!(
1015 |_| Some(Degrees(26.0)),
1016 [
1017 alos_26_degrees => alos, alos_degrees_basedon_lechumra_doc!(26, 120),
1018 tzeis_26_degrees => tzeis, tzeis_degrees_basedon_doc!(26, 120),
1019 shaah_zmanis_mga_26_degrees => shaah_zmanis_mga, shaah_mga_degrees_lechumra_basedon_doc!(26, 120),
1020 plag_mga_26_degrees => plag_mga, plag_mga_degrees_lechumra_doc!(26),
1021 ]
1022 );
1023
1024 zmanim_for_offset!(
1025 |_| Some(Minutes(60.0)),
1026 [
1027 alos_60_minutes => alos, "Returns *alos* (dawn) calculated as 60 minutes before sunrise. This is the time to walk the distance of 4 *mil* at 15 minutes a *mil*. This seems to be the opinion of the *Chavas Yair* in the *Mekor Chaim, Orach Chaim* Ch. 90, though the *Mekor Chaim* in Ch. 58 and in the *Chut Hashani* Ch. 97 states that a person walks 3 and a 1/3 *mil* in an hour, or an 18-minute *mil*. Also see the *Divrei Malkiel* Vol. 4, Ch. 20, page 34) who mentions the 15 minute *mil lechumra* by baking *matzos*. Also see the *Maharik* Ch. 173 where the questioner quoting the *Ra'avan* is of the opinion that the time to walk a *mil* is 15 minutes (5 *mil* in a little over an hour). There are many who believe that there is a *ta'us sofer* (scribeal error) in the *Ra'avan*, and it should 4 *mil* in a little over an hour, or an 18-minute *mil*. Time based offset calculations are based on the opinion of the *Rishonim* who stated that the time of the *neshef* (time between dawn and sunrise) does not vary by the time of year or location but purely depends on the time it takes to walk the distance of 4 *mil*.",
1028 tzeis_60_minutes => tzeis, "Returns *tzeis hakochavim* (nightfall) based on the opinion of the *Chavas Yair* and *Divrei Malkiel* that the time to walk the distance of a mil is 15 minutes, for a total of 60 minutes for 4 *mil* after sunset. See detailed documentation explaining the 60 minute concept at [alos_60_minutes](ComplexZmanimCalendar::alos_60_minutes).",
1029 shaah_zmanis_mga_60_minutes => shaah_zmanis_mga, shaah_mga_minutes_doc!(60),
1030 plag_mga_60_minutes => plag_mga, plag_mga_minutes_doc!(60),
1031 ]
1032 );
1033
1034 zmanim_for_offset!(
1035 |_| Some(Minutes(72.0)),
1036 [
1037 alos_72_minutes => alos, alos_minutes_basedon_doc!(72, 18),
1038 tzeis_72_minutes => tzeis, "Returns *tzeis hakochavim* (nightfall) based on the opinion of *Rabbeinu Tam* that *tzeis hakochavim* is calculated as 72 minutes after sunset, the time it takes to walk 4 *mil* at 18 minutes a mil. According to the *Machtzis Hashekel* in *Orach Chaim* 235:3, the *Pri Megadim* in *Orach Chaim* 261:2 (see the *Biur Halacha*) and others (see *Hazmanim Bahalacha* 17:3 and 17:5) the 72 minutes are standard clock minutes any time of the year in any location.",
1039 shaah_zmanis_mga_72_minutes => shaah_zmanis_mga, shaah_mga_minutes_doc!(72),
1040 sof_zman_shema_mga_72_minutes => sof_zman_shema_mga, szks_mga_minutes_doc!(72),
1041 sof_zman_tefila_mga_72_minutes => sof_zman_tefila_mga, szt_mga_minutes_doc!(72),
1042 sof_zman_biur_chametz_mga_72_minutes => sof_zman_biur_chametz_mga, sz_biur_chametz_mga_minutes_doc!(72),
1043 mincha_gedola_mga_72_minutes => mincha_gedola_mga, mg_mga_minutes_doc!(72),
1044 samuch_lemincha_ketana_mga_72_minutes => samuch_lemincha_ketana_mga, slmk_mga_minutes_doc!(72),
1045 mincha_ketana_mga_72_minutes => mincha_ketana_mga, mk_mga_minutes_doc!(72),
1046 plag_mga_72_minutes => plag_mga, plag_mga_minutes_lechumra_doc!(72),
1047 ]
1048 );
1049
1050 zmanim_for_offset!(
1051 |this: &ComplexZmanimCalendar| {
1052 Some(MinutesZmaniyos {
1053 minutes_zmaniyos: 72.0,
1054 shaah_zmanis: this.shaah_zmanis_gra()?,
1055 })
1056 },
1057 [
1058 alos_72_minutes_zmanis => alos, concat!(
1059 alos_minutes_zmanis_basedon_doc!(72, 18, "1/10th"),
1060 "\nThis calculation is used in the calendars published by the Hisachdus Harabanim D'Artzos Habris Ve'Canada."
1061 ),
1062 tzeis_72_minutes_zmanis => tzeis, "Returns *tzeis hakochavim* (nightfall) calculated as 72 minutes *zmaniyos*, or 1/10th of the day after sunset. This is the way that the *Minchas Cohen* in *Ma'amar* 2:4 calculates *Rebbeinu Tam*'s time of *tzeis*. It should be noted that this calculation results in the shortest time from sunset to *tzeis* being during the winter solstice, the longest at the summer solstice and 72 clock minutes at the equinox. This does not match reality, since there is no direct relationship between the length of the day and twilight. The shortest twilight is during the equinox, the longest is during the summer solstice, and in the winter with the shortest daylight, the twilight period is longer than during the equinoxes.",
1063 shaah_zmanis_mga_72_minutes_zmanis => shaah_zmanis_mga, shaah_mga_minutes_zmanis_doc!(72, "1/10th"),
1064 sof_zman_shema_mga_72_minutes_zmanis => sof_zman_shema_mga, szks_mga_minutes_zmanis_doc!(72, "1/10th"),
1065 sof_zman_tefila_mga_72_minutes_zmanis => sof_zman_tefila_mga, szt_mga_minutes_zmanis_doc!(72, "1/10th"),
1066 sof_zman_biur_chametz_mga_72_minutes_zmanis => sof_zman_biur_chametz_mga, sz_biur_chametz_mga_minutes_zmanis_doc!(72, "1/10th"),
1067 plag_mga_72_minutes_zmanis => plag_mga, plag_mga_minutes_zmanis_lechumra_doc!(72, "1/10th"),
1068 ]
1069 );
1070
1071 zmanim_for_offset!(
1072 |_| Some(Minutes(90.0)),
1073 [
1074 alos_90_minutes => alos, alos_minutes_basedon_doc!(90, 22.5),
1075 tzeis_90_minutes => tzeis, "Returns *tzeis hakochavim* (dusk) calculated as 90 minutes after sunset. This method returns *tzeis* based on the opinion of the *Magen Avraham* that the time to walk the distance of a *mil* according to the *Rambam*'s opinion is 18 minutes, for a total of 90 minutes based on the opinion of Ula who calculated *tzeis* as 5 *mil* after *shkiah* (sunset). A similar calculation [tzeis_19_8_degrees](ComplexZmanimCalendar::tzeis_19_8_degrees) uses solar position calculations based on this time.",
1076 shaah_zmanis_mga_90_minutes => shaah_zmanis_mga, shaah_mga_minutes_doc!(90),
1077 sof_zman_shema_mga_90_minutes => sof_zman_shema_mga, szks_mga_minutes_doc!(90),
1078 sof_zman_tefila_mga_90_minutes => sof_zman_tefila_mga, szt_mga_minutes_doc!(90),
1079 plag_mga_90_minutes => plag_mga, plag_mga_minutes_lechumra_doc!(90),
1080 ]
1081 );
1082
1083 zmanim_for_offset!(
1084 |this: &ComplexZmanimCalendar| {
1085 Some(MinutesZmaniyos {
1086 minutes_zmaniyos: 90.0,
1087 shaah_zmanis: this.shaah_zmanis_gra()?,
1088 })
1089 },
1090 [
1091 alos_90_minutes_zmanis => alos, alos_minutes_zmanis_basedon_doc!(90, 22.5, "1/8th"),
1092 tzeis_90_minutes_zmanis => tzeis, concat!(
1093 tzeis_minutes_zmanis_basedon_doc!(90, 22.5, "1/8th"),
1094 " This time is known in Yiddish as the *achtel* (an eighth) *zman*."
1095 ),
1096 shaah_zmanis_mga_90_minutes_zmanis => shaah_zmanis_mga, shaah_mga_minutes_zmanis_doc!(90, "1/8th"),
1097 sof_zman_shema_mga_90_minutes_zmanis => sof_zman_shema_mga, szks_mga_minutes_zmanis_doc!(90, "1/8th"),
1098 sof_zman_tefila_mga_90_minutes_zmanis => sof_zman_tefila_mga, szt_mga_minutes_zmanis_doc!(90, "1/8th"),
1099 plag_mga_90_minutes_zmanis => plag_mga, plag_mga_minutes_zmanis_lechumra_doc!(90, "1/8th"),
1100 ]
1101 );
1102
1103 zmanim_for_offset!(
1104 |_| Some(Minutes(96.0)),
1105 [
1106 alos_96_minutes => alos, alos_minutes_basedon_doc!(96, 24),
1107 tzeis_96_minutes => tzeis, tzeis_minutes_basedon_doc!(96, 24),
1108 shaah_zmanis_mga_96_minutes => shaah_zmanis_mga, shaah_mga_minutes_doc!(96),
1109 sof_zman_shema_mga_96_minutes => sof_zman_shema_mga, szks_mga_minutes_doc!(96),
1110 sof_zman_tefila_mga_96_minutes => sof_zman_tefila_mga, szt_mga_minutes_doc!(96),
1111 plag_mga_96_minutes => plag_mga, plag_mga_minutes_lechumra_doc!(96),
1112 ]
1113 );
1114
1115 zmanim_for_offset!(
1116 |this: &ComplexZmanimCalendar| {
1117 Some(MinutesZmaniyos {
1118 minutes_zmaniyos: 96.0,
1119 shaah_zmanis: this.shaah_zmanis_gra()?,
1120 })
1121 },
1122 [
1123 alos_96_minutes_zmanis => alos, alos_minutes_zmanis_basedon_doc!(96, 22.5, "1/7.5th"),
1124 tzeis_96_minutes_zmanis => tzeis, tzeis_minutes_zmanis_basedon_doc!(96, 22.5, "1/7.5th"),
1125 shaah_zmanis_mga_96_minutes_zmanis => shaah_zmanis_mga, shaah_mga_minutes_zmanis_doc!(96, "1/7.5th"),
1126 sof_zman_shema_mga_96_minutes_zmanis => sof_zman_shema_mga, szks_mga_minutes_zmanis_doc!(96, "1/7.5th"),
1127 sof_zman_tefila_mga_96_minutes_zmanis => sof_zman_tefila_mga, szt_mga_minutes_zmanis_doc!(96, "1/7.5th"),
1128 plag_mga_96_minutes_zmanis => plag_mga, plag_mga_minutes_zmanis_lechumra_doc!(96, "1/7.5th"),
1129 ]
1130 );
1131
1132 zmanim_for_offset!(
1133 |_| Some(Minutes(120.0)),
1134 [
1135 alos_120_minutes => alos, "This method should be used *lechumra* only and returns *alos* (dawn) calculated using 120 minutes before sea level sunrise (no adjustment for elevation is made) based on the time to walk the distance of 5 *mil* (Ula) at 24 minutes a *mil*. Time based offset calculations for *alos* are based on the* opinion of the Rishonim who stated that the time of the *neshef* (time between dawn and sunrise) does not vary by the time of year or location but purely depends on the time it takes to walk the distance of 5 *mil* (Ula). Since this time is extremely early, it should only be used *lechumra*, such as not eating after this time on a fast day, and **not** as the start time for *mitzvos* that can only be performed during the day.",
1136 tzeis_120_minutes => tzeis, "Returns *tzeis hakochavim* (dusk) calculated as 120 minutes after sunset. For information on how this is calculated see the documentation on [alos_120_minutes](ComplexZmanimCalendar::alos_120_minutes).",
1137 shaah_zmanis_mga_120_minutes => shaah_zmanis_mga, shaah_mga_minutes_doc!(120),
1138 sof_zman_shema_mga_120_minutes => sof_zman_shema_mga, szks_mga_minutes_doc!(120),
1139 sof_zman_tefila_mga_120_minutes => sof_zman_tefila_mga, szt_mga_minutes_doc!(120),
1140 plag_mga_120_minutes => plag_mga, plag_mga_minutes_lechumra_doc!(120),
1141 ]
1142 );
1143
1144 zmanim_for_offset!(
1145 |this: &ComplexZmanimCalendar| {
1146 Some(MinutesZmaniyos {
1147 minutes_zmaniyos: 120.0,
1148 shaah_zmanis: this.shaah_zmanis_gra()?,
1149 })
1150 },
1151 [
1152 alos_120_minutes_zmanis => alos, "This method should be used *lechumra* only and method returns *alos* (dawn) calculated using 120 minutes *zmaniyos* or 1/6th of the day before sunrise. This is based on a 24-minute *mil* so the time for 5 mil is 120 minutes which is 1/6th of a day `(12 * 60) / 6 = 120`. The day is calculated from sunrise to sunset. Since this time is extremely early, it should only be used *lechumra*, such as not eating after this time on a fast day, and **not** as the start time for *mitzvos* that can only be performed during the day.",
1153 tzeis_120_minutes_zmanis => tzeis, "This method should be used *lechumra* only and returns *tzeis* (dusk) calculated using 120 minutes *zmaniyos* after sunset. Since the *zman* is extremely late and at a time when the sun is well below the 18° point (scientifically the darkest point) in most places on the globe, it should only be used *lechumra*, such as delaying the start of nighttime mitzvos.",
1154 shaah_zmanis_mga_120_minutes_zmanis => shaah_zmanis_mga, "Returns a *shaah zmanis* (temporal hour) calculated using a dip of 120 minutes. This calculation divides the day based on the opinion of the *Magen Avraham* (MGA) that the day runs from dawn to dusk. Dawn for this calculation is 120 minutes before sunrise and dusk is 120 minutes after sunset. This day is split into 12 equal parts with each part being a *shaah zmanis*. This is identical to 1/6th of the day from sunrise to sunset. Since *zmanim* that use this method are extremely late or early and at a point when the sky is a long time past the 18° point where the darkest point is reached, *zmanim* that use this should only be used *lechumra* only, such as delaying the start of nighttime *mitzvos*.",
1155 plag_mga_120_minutes_zmanis => plag_mga, plag_mga_minutes_zmanis_lechumra_doc!(120, "1/6th"),
1156 ]
1157 );
1158
1159 // Other Misheyakir
1160 /// Returns *misheyakir* based on the position of the sun 12.85° below
1161 /// geometric zenith (90°). This is based on the position of the sun
1162 /// slightly later than 57 minutes before sunrise in Jerusalem around the
1163 /// equinox / equilux. This *zman* is mentioned for use ***bish'as
1164 /// hadchak*** in the Birur Halacha Tinyana and Tlisa'ah in Orach Chaim
1165 /// siman 18 as 12.85°. Actual calculations show it to be slightly more
1166 /// than 12.9°, but the Birur Halacha indicates that 12.85° is a
1167 /// slight *chumra* (on a *bedieved* time) VS the 12.9° that 57 minutes
1168 /// calculates as (a difference of about 14 seconds at the equinox/equilux
1169 /// in Jerusalem). The *zman* of 12.9° is also mentioned in the Piskei
1170 /// Tshuvos siman 18, page 190 (where a typo indicates that this is the
1171 /// degree equivalent to 60 minutes before sunrise, when in fact at that
1172 /// point the sun is about 13.5° below the horizon). The 57 minute based
1173 /// time is mentioned by the Minchas Yitzchak vol. 9, siman 9 as 15 minutes
1174 /// before *alos hashachar* (though he is not clear what location he refers
1175 /// to, and does not mention a degree-based conversion). The Kaf Hachaim
1176 /// vol.1 siman 18, no. 18 states that in Yerushalayim 60 fixed minutes are
1177 /// used year round. Calculations show that 60 fixed minutes in Yerushalayim
1178 /// ranges from 13.5° at the spring equinox to 11.5° at the summer
1179 /// solstice. 57 minutes range from 12.9° at the winter equinox to
1180 /// 11° at the summer solstice. Analysis of the difference between
1181 /// 12.85° and 12.9°, shows that the maximum difference occurs at
1182 /// the summer solstice. In Lakewood, NJ at a latitude of 40.096°, the
1183 /// maximum difference throughout the year is 23 seconds. In the winter
1184 /// where there is the greatest need for very early *misheyakir* times, the
1185 /// difference is in the 16 second range. Going north to Montreal at
1186 /// latitude 45.5°, the maximum is 29 seconds and is about 18 seconds in
1187 /// the winter. Moving farther north to the elevation of Vilnius at a
1188 /// latitude of 54.68°, things change. Firstly, around the summer
1189 /// solstice it will not reach that far below the horizon. On the dates that
1190 /// both can be calculated, the maximum difference can be pretty high on one
1191 /// or two days of the year (around Jul 8), with about a week having over a
1192 /// two minute difference between the two. Even at the latitude of Vilna,
1193 /// from Dec - March, the difference is about 22 seconds.
1194 #[must_use]
1195 pub fn misheyakir_12_85_degrees(&self) -> Option<Zoned> {
1196 self.alos(&Degrees(12.85))
1197 }
1198
1199 /// Returns *misheyakir* based on the position of the sun when
1200 /// it is 11.5° below geometric zenith (90°). This calculation is
1201 /// used for calculating *misheyakir* according to some opinions. This
1202 /// calculation is based on the position of the sun 52 minutes before
1203 /// sunrise in Jerusalem around the equinox / equilux, which calculates
1204 /// to 11.5° below geometric zenith.
1205 #[must_use]
1206 pub fn misheyakir_11_5_degrees(&self) -> Option<Zoned> {
1207 self.alos(&Degrees(11.5))
1208 }
1209
1210 /// Returns *misheyakir* based on the position of the sun when
1211 /// it is 11° below geometric zenith (90°). This calculation is used
1212 /// for calculating *misheyakir* according to some opinions. This
1213 /// calculation is based on the position of the sun 48 minutes before
1214 /// sunrise in Jerusalem around the equinox / equilux, which calculates
1215 /// to 11° below geometric zenith.
1216 #[must_use]
1217 pub fn misheyakir_11_degrees(&self) -> Option<Zoned> {
1218 self.alos(&Degrees(11.0))
1219 }
1220
1221 /// Returns *misheyakir* based on the position of the sun when
1222 /// it is 10.2° below geometric zenith (90°). This calculation is
1223 /// used for calculating *misheyakir* according to some opinions. This
1224 /// calculation is based on the position of the sun 45 minutes before
1225 /// sunrise in Jerusalem around the equinox which calculates to 10.2°
1226 /// below geometric zenith.
1227 #[must_use]
1228 pub fn misheyakir_10_2_degrees(&self) -> Option<Zoned> {
1229 self.alos(&Degrees(10.2))
1230 }
1231
1232 /// Returns *misheyakir* based on the position of the sun when
1233 /// it is 9.5° below geometric zenith (90°). This calculation is
1234 /// based on Rabbi Dovid Kronglass's Calculation of 45 minutes in
1235 /// Baltimore as mentioned in *Divrei Chachamim* No. 24 brought down by
1236 /// the *Birur Halacha*, *Tinyana*, Ch. 18. This calculates to 9.5°.
1237 /// Also see Rabbi Yaakov Yitzchok Neiman in *Kovetz Eitz Chaim* Vol. 9,
1238 /// p. 202 that the *Vya'an Yosef* did not want to rely on times earlier
1239 /// than 45 minutes in New York. This *zman* is also used in the
1240 /// calendars published by Rabbi Hershel Edelstein. As mentioned in
1241 /// Yisroel Vehazmanim, Rabbi Edelstein who was given the 45 minute
1242 /// *zman* by Rabbi Bick. The calendars published by the *Edot
1243 /// Hamizrach* communities also use this *zman*. This also follows the
1244 /// opinion of Rabbi Shmuel Kamenetsky who provided the time of 36 and
1245 /// 45 minutes, but did not provide a degree-based time. Since this
1246 /// *zman* depends on the level of light, Rabbi Yaakov Shakow presented
1247 /// these degree-based times to Rabbi Shmuel Kamenetsky who agreed to
1248 /// them.
1249 #[must_use]
1250 pub fn misheyakir_9_5_degrees(&self) -> Option<Zoned> {
1251 self.alos(&Degrees(9.5))
1252 }
1253
1254 /// Returns *misheyakir* based on the position of the sun when
1255 /// it is 7.65° below geometric zenith (90°). The degrees are based
1256 /// on a 35/36 minute *zman* around the equinox / equilux, when the
1257 /// *neshef* (twilight) is the shortest. This time is based on Rabbi
1258 /// Moshe Feinstein who writes in *Ohr Hachaim* Vol. 4, Ch. 6 that
1259 /// *misheyakir* in New York is 35-40 minutes before sunrise, something
1260 /// that is a drop less than 8°. Rabbi Yisroel Taplin in *Zmanei
1261 /// Yisrael* (page 117) notes that Rabbi Yaakov Kamenetsky stated that
1262 /// it is not less than 36 minutes before sunrise (maybe it is
1263 /// 40 minutes). *Sefer Yisrael Vehazmanim* (p. 7) quotes the *Tamar
1264 /// Yifrach* in the name of the Satmar Rov that one should be stringent
1265 /// not consider *misheyakir* before 36 minutes. This is also the
1266 /// accepted *minhag* in Lakewood that is used in the Yeshiva. This
1267 /// follows the opinion of Rabbi Shmuel Kamenetsky who provided the time
1268 /// of 35/36 minutes, but did not provide a degree-based time. Since
1269 /// this *zman* depends on the level of light, Rabbi Yaakov Shakow
1270 /// presented this degree-based calculations to Rabbi Shmuel Kamenetsky
1271 /// who agreed to them.
1272 #[must_use]
1273 pub fn misheyakir_7_65_degrees(&self) -> Option<Zoned> {
1274 self.alos(&Degrees(7.65))
1275 }
1276
1277 // Bein Hashmashos Yereim
1278 /// Returns the beginning of *bein hashmashos* (twilight)
1279 /// according to the Yereim (Rabbi Eliezer of Metz) calculated as 18 minutes
1280 /// or 3/4 of a 24-minute mil before sunset. According to the Yereim, bein
1281 /// hashmashos starts 3/4 of a mil before sunset and *tzeis* or nightfall
1282 /// starts at sunset.
1283 #[must_use]
1284 pub fn bein_hashmashos_yereim_18_minutes(&self) -> Option<Zoned> {
1285 self.tzeis(&Minutes(-18.0))
1286 }
1287
1288 /// Returns the beginning of *bein hashmashos* (twilight)
1289 /// according to the Yereim (Rabbi Eliezer of Metz) calculated as the sun's
1290 /// position 3.05° above the horizon around the equinox / equilux, its
1291 /// position 18 minutes or 3/4 of an 24-minute mil before sunset. According
1292 /// to the Yereim, *bein hashmashos* starts 3/4 of a mil before sunset and
1293 /// *tzeis* or nightfall starts at sunset. Note that lechumra (of about 14
1294 /// seconds) a refraction value of 0.5166° as opposed to the traditional
1295 /// 0.566° is used. This is more inline with the actual refraction in
1296 /// Eretz Yisrael and is brought down by Rabbi Yedidya Manet in his
1297 /// Zmanei Halacha Lema'aseh (p. 11). That is the first source that I am
1298 /// aware of that calculates degree-based Yereim zmanim. The 0.5166°
1299 /// refraction is also used by the Luach Itim Lebinah. Calculating the
1300 /// Yereim's *bein hashmashos* using 18-minute based degrees is also
1301 /// suggested in the upcoming 8th edition of the zmanim Kehilchasam. For
1302 /// more details, see the article The Yereim's Bein Hashmashos.
1303 #[must_use]
1304 pub fn bein_hashmashos_yereim_3_05_degrees(&self) -> Option<Zoned> {
1305 self.tzeis(&Degrees(-3.05))
1306 }
1307
1308 /// Returns the beginning of *bein hashmashos* (twilight)
1309 /// according to the Yereim (Rabbi Eliezer of Metz) calculated as 16.875
1310 /// minutes or 3/4 of a 22.5-minute mil before sunset. According to the
1311 /// Yereim, *bein hashmashos* starts 3/4 of a mil before sunset and *tzeis*
1312 /// or nightfall starts at sunset.
1313 #[must_use]
1314 pub fn bein_hashmashos_yereim_16_875_minutes(&self) -> Option<Zoned> {
1315 self.tzeis(&Minutes(-16.875))
1316 }
1317
1318 /// Returns the beginning of *bein hashmashos* (twilight)
1319 /// according to the Yereim (Rabbi Eliezer of Metz) calculated as the sun's
1320 /// position 2.8° above the horizon around the equinox / equilux, its
1321 /// position 16.875 minutes or 3/4 of an 18-minute mil before sunset.
1322 /// According to the Yereim, *bein hashmashos* starts 3/4 of a mil before
1323 /// sunset and *tzeis* or nightfall starts at sunset. Details, including how
1324 /// the degrees were calculated can be seen in the documentation of
1325 /// [`bein_hashmashos_yereim_3_05_degrees`](ComplexZmanimCalendar::bein_hashmashos_yereim_3_05_degrees).
1326 #[must_use]
1327 pub fn bein_hashmashos_yereim_2_8_degrees(&self) -> Option<Zoned> {
1328 self.tzeis(&Degrees(-2.8))
1329 }
1330
1331 /// Returns the beginning of *bein hashmashos* (twilight)
1332 /// according to the Yereim (Rabbi Eliezer of Metz) calculated as 13.5
1333 /// minutes or 3/4 of an 18-minute mil before sunset. According to the
1334 /// Yereim, *bein hashmashos* starts 3/4 of a mil before sunset and *tzeis*
1335 /// or nightfall starts at sunset.
1336 #[must_use]
1337 pub fn bein_hashmashos_yereim_13_5_minutes(&self) -> Option<Zoned> {
1338 self.tzeis(&Minutes(-13.5))
1339 }
1340
1341 /// Returns the beginning of *bein hashmashos* according to the
1342 /// Yereim (Rabbi Eliezer of Metz) calculated as the sun's position 2.1°
1343 /// above the horizon around the equinox / equilux in Yerushalayim, its
1344 /// position 13.5 minutes or 3/4 of an 18-minute mil before sunset.
1345 /// According to the Yereim, *bein hashmashos* starts 3/4 of a mil before
1346 /// sunset and *tzeis* or nightfall starts at sunset. Details, including how
1347 /// the degrees were calculated can be seen in the documentation of
1348 /// [`bein_hashmashos_yereim_3_05_degrees`](ComplexZmanimCalendar::bein_hashmashos_yereim_3_05_degrees).
1349 #[must_use]
1350 pub fn bein_hashmashos_yereim_2_1_degrees(&self) -> Option<Zoned> {
1351 self.tzeis(&Degrees(-2.1))
1352 }
1353
1354 // Bein Hashmashos Rabeinu Tam
1355 /// Method to return the beginning of *bein hashmashos* of Rabbeinu Tam
1356 /// calculated when the sun is 13.24° below the western geometric
1357 /// horizon (90°) after sunset. This calculation is based on the
1358 /// same calculation of [*bein hashmashos* Rabbeinu Tam
1359 /// 58.5](ComplexZmanimCalendar::bein_hashmashos_rt_58_5_minutes) minutes
1360 /// but uses a degree-based calculation instead of 58.5 exact minutes.
1361 /// This calculation is based on the position of the sun 58.5 minutes
1362 /// after sunset in Jerusalem around the equinox / equilux, which
1363 /// calculates to 13.24° below geometric zenith. NOTE: As per
1364 /// Yisrael Vehazmanim Vol. III page 1028, No. 50, a dip of slightly
1365 /// less than 13° should be used. Calculations show that the proper
1366 /// dip to be 13.2456° (truncated to 13.24 that provides about 1.5
1367 /// second earlier (*lechumra*) time) below the horizon at that time. This
1368 /// makes a difference of 1 minute and 10 seconds in Jerusalem during the
1369 /// Equinox, and 1 minute 29 seconds during the solstice as compared to the
1370 /// proper 13.24° versus 13°. For NY during the solstice, the
1371 /// difference is 1 minute 56 seconds.
1372 #[must_use]
1373 pub fn bein_hashmashos_rt_13_24_degrees(&self) -> Option<Zoned> {
1374 self.tzeis(&Degrees(13.24))
1375 }
1376
1377 /// Returns the beginning of *bein hashmashos* of Rabbeinu Tam
1378 /// calculated as a 58.5-minute offset after sunset. *bein hashmashos* is
1379 /// 3/4 of a mil before *tzeis* or 3 1/4 mil after sunset. With a mil
1380 /// calculated as 18 minutes, 3.25 * 18 = 58.5 minutes.
1381 #[must_use]
1382 pub fn bein_hashmashos_rt_58_5_minutes(&self) -> Option<Zoned> {
1383 self.tzeis(&Minutes(58.5))
1384 }
1385
1386 /// Returns the beginning of *bein hashmashos* based on the
1387 /// calculation of 13.5 minutes (3/4 of an 18-minute mil) before *shkiah*
1388 /// calculated as 7.083°.
1389 #[must_use]
1390 pub fn bein_hashmashos_rt_13_5_minutes_before_7_083_degrees(&self) -> Option<Zoned> {
1391 self.tzeis_geonim_7_083_degrees()?
1392 .checked_sub(SignedDuration::from_secs(810))
1393 .ok()
1394 }
1395
1396 /// Returns the beginning of *bein hashmashos* of Rabbeinu Tam
1397 /// calculated according to the opinion of the Divrei Yosef (see Yisrael
1398 /// Vehazmanim) calculated 5/18th (27.77%) of the time between alos
1399 /// (calculated as 19.8° before sunrise) and sunrise. This is added to
1400 /// sunset to arrive at the time for *bein hashmashos* of Rabbeinu Tam.
1401 #[must_use]
1402 pub fn bein_hashmashos_rt_2_stars(&self) -> Option<Zoned> {
1403 let sunrise = self.zmanim_sunrise()?;
1404 let alos = self.alos_19_8_degrees()?;
1405 self.zmanim_sunset()?
1406 .checked_add(sunrise.duration_since(&alos) * 5 / 18)
1407 .ok()
1408 }
1409
1410 // Other tzeis
1411 /// Returns the *tzeis hakochavim* (nightfall) based on the
1412 /// opinion of the *Geonim* calculated at the sun's position at 3.7°
1413 /// below the western horizon. This is a very early *zman* and should not be
1414 /// relied on without Rabbinical guidance.
1415 #[must_use]
1416 pub fn tzeis_geonim_3_7_degrees(&self) -> Option<Zoned> {
1417 self.tzeis(&Degrees(3.7))
1418 }
1419
1420 /// Returns the *tzeis hakochavim* (nightfall) based on the
1421 /// opinion of the *Geonim* calculated at the sun's position at 3.8°
1422 /// below the western horizon. This is a very early *zman* and should not be
1423 /// relied on without Rabbinical guidance.
1424 #[must_use]
1425 pub fn tzeis_geonim_3_8_degrees(&self) -> Option<Zoned> {
1426 self.tzeis(&Degrees(3.8))
1427 }
1428
1429 /// Returns the *tzeis hakochavim* (nightfall) based on the
1430 /// opinion of the *Geonim* calculated as 3/4 of a *mil*, based on a
1431 /// 22.5-minute *mil*, or 16 7/8 minutes. It is the sun's position at
1432 /// 4.37° below the western horizon. This is a very early *zman* and
1433 /// should not be relied on without Rabbinical guidance.
1434 #[must_use]
1435 pub fn tzeis_geonim_4_37_degrees(&self) -> Option<Zoned> {
1436 self.tzeis(&Degrees(4.37))
1437 }
1438
1439 /// Returns the *tzeis hakochavim* (nightfall) based on the
1440 /// opinion of the *Geonim* calculated as 3/4 of a *mil* based on a
1441 /// 24-minute *mil*, or 18 minutes. It is the sun's position at 4.61°
1442 /// below the western horizon. This is a very early *zman* and should
1443 /// not be relied on without Rabbinical guidance.
1444 #[must_use]
1445 pub fn tzeis_geonim_4_61_degrees(&self) -> Option<Zoned> {
1446 self.tzeis(&Degrees(4.61))
1447 }
1448
1449 /// Returns the *tzeis* (nightfall) based on the opinion of the
1450 /// *Geonim* calculated as 3/4 of a *mil* based on the sun's position at
1451 /// 4.8° below the western horizon. This is based on Rabbi Leo Levi's
1452 /// calculations. This is a very early *zman* and should not be relied on
1453 /// without Rabbinical guidance.
1454 #[must_use]
1455 pub fn tzeis_geonim_4_8_degrees(&self) -> Option<Zoned> {
1456 self.tzeis(&Degrees(4.8))
1457 }
1458
1459 /// Returns the *tzeis* (nightfall) based on the opinion of the
1460 /// *Geonim* calculated as 3/4 of a 24-minute *mil*, based on a mil being 24
1461 /// minutes, and is calculated as 18 + 2 + 4 for a total of 24 minutes. It
1462 /// is the sun's position at 5.88° below the western horizon. This is a
1463 /// very early *zman* and should not be relied on without Rabbinical
1464 /// guidance.
1465 #[must_use]
1466 pub fn tzeis_geonim_5_88_degrees(&self) -> Option<Zoned> {
1467 self.tzeis(&Degrees(5.88))
1468 }
1469
1470 /// Returns the *tzeis hakochavim* (nightfall) based on the
1471 /// opinion of the *Geonim* calculated at the sun's position at 5.95°
1472 /// below the western horizon. This is a very early *zman* and should not be
1473 /// relied on without Rabbinical guidance.
1474 #[must_use]
1475 pub fn tzeis_geonim_5_95_degrees(&self) -> Option<Zoned> {
1476 self.tzeis(&Degrees(5.95))
1477 }
1478
1479 /// Returns the *tzeis* (nightfall) based on the opinion of the
1480 /// *Geonim* as calculated by Rabbi Yechiel Michel Tucazinsky. It is based
1481 /// on of the position of the sun no later than 31 minutes after sunset
1482 /// in Jerusalem the height of the summer solstice and is 28 minutes
1483 /// after *shkiah* around the equinox / equilux. This computes to 6.45°
1484 /// below the western horizon.
1485 #[must_use]
1486 pub fn tzeis_geonim_6_45_degrees(&self) -> Option<Zoned> {
1487 self.tzeis(&Degrees(6.45))
1488 }
1489
1490 /// Returns the *tzeis hakochavim* (nightfall) based on the
1491 /// opinion of the *Geonim* calculated when the sun's position 7.083°
1492 /// (or 7° 5′) below the western horizon. This is often referred to
1493 /// as 7°5' or 7° and 5 minutes. This calculation is based on
1494 /// the observation of 3 medium-sized stars by Dr. Baruch (Berthold)
1495 /// Cohn in his luach Tabellen enthaltend die Zeitangaben für den Beginn
1496 /// der Nacht und des Tages für die Breitengrade + 66 bis -38 published
1497 /// in Strasbourg, France in 1899. This calendar was very popular in
1498 /// Europe, and many other calendars based their time on it. Rav Dovid
1499 /// Tzvi Hoffman in his *Sh"Ut Melamed Leho'il* in an exchange of
1500 /// letters with Baruch Cohn in *Orach Chaim* 30 agreed to this *zman*
1501 /// (page 36), as did the *Sh"Ut Bnei Tziyon* and the *Tenuvas
1502 /// Sadeh*. It is very close to the time of the *Mekor Chesed* of the *Sefer
1503 /// chasidim*. It is close to the position of the sun 30 minutes after
1504 /// sunset in Jerusalem around the equinox / equilux, but not Exactly. The
1505 /// actual position of the sun 30 minutes after sunset in Jerusalem at the
1506 /// equilux is 7.205° and 7.199° at the equinox. See *Hazmanim
1507 /// Bahalacha* vol 2, pages 520-521 for more details.
1508 #[must_use]
1509 pub fn tzeis_geonim_7_083_degrees(&self) -> Option<Zoned> {
1510 self.tzeis(&Degrees(7.0 + (5.0 / 60.0)))
1511 }
1512
1513 /// Returns *tzeis* (nightfall) based on the opinion of the
1514 /// Geonim calculated as 45 minutes after sunset during the summer solstice
1515 /// in New York, when the *neshef* (twilight) is the longest. The sun's
1516 /// position at this time computes to 7.75° below the western horizon.
1517 /// See Igros Moshe Even Haezer 4, Ch. 4 (regarding *tzeis* for *krias
1518 /// Shema*). It is also mentioned in Rabbi Heber's *Shaarei Zmanim* on in
1519 /// chapter 10 (page 87) and chapter 12 (page 108). Also see the time of 45
1520 /// minutes in Rabbi Simcha Bunim Cohen's The radiance of Shabbos as the
1521 /// earliest *zman* for New York. This *zman* is also listed in the *Divrei
1522 /// Shalom* Vol. III, chapter 75, and *Beis Av"i* Vol. III, chapter 117.
1523 /// This *zman* is also listed in the *Divrei Shalom* etc. chapter 177
1524 /// (FIXME - could not be located). Since this *zman* depends on the level
1525 /// of light, Rabbi Yaakov Shakow presented this degree-based calculation to
1526 /// Rabbi Rabbi Shmuel Kamenetsky who agreed to it.
1527 #[must_use]
1528 pub fn tzeis_geonim_7_67_degrees(&self) -> Option<Zoned> {
1529 self.tzeis(&Degrees(7.67))
1530 }
1531
1532 /// Returns *tzeis* (nightfall) when the sun is 8.5° below the geometric
1533 /// horizon (90°) after sunset, a time that Rabbi Meir Posen in his the
1534 /// *Ohr Meir* calculated that 3 small stars are visible, which is later
1535 /// than the required 3 medium stars. This calculation is based on the sun's
1536 /// position below the horizon 36 minutes after sunset in Jerusalem around
1537 /// the equinox / equilux.
1538 #[must_use]
1539 pub fn tzeis_geonim_8_5_degrees(&self) -> Option<Zoned> {
1540 self.tzeis(&Degrees(8.5))
1541 }
1542
1543 /// Returns the *tzeis* (nightfall) based on the calculations
1544 /// used in the *Luach Itim Lebinah* as the stringent time for *tzeis*. It
1545 /// is calculated at the sun's position at 9.3° below the western
1546 /// horizon.
1547 #[must_use]
1548 pub fn tzeis_geonim_9_3_degrees(&self) -> Option<Zoned> {
1549 self.tzeis(&Degrees(9.3))
1550 }
1551
1552 /// Returns the *tzeis* (nightfall) based on the opinion of the
1553 /// *Geonim* calculated as 60 minutes after sunset around the equinox /
1554 /// equilux, the day that a solar hour is 60 minutes in New York. The sun's
1555 /// position at this time computes to 9.75° below the western horizon.
1556 /// This is the opinion of Rabbi Eliyahu Henkin. This also follows the
1557 /// opinion of Rabbi Shmuel Kamenetsky. Rabbi Yaakov Shakow presented
1558 /// these degree-based times to Rabbi Shmuel Kamenetsky who agreed to
1559 /// them.
1560 #[must_use]
1561 pub fn tzeis_geonim_9_75_degrees(&self) -> Option<Zoned> {
1562 self.tzeis(&Degrees(9.75))
1563 }
1564}
1565
1566/// When to use elevation for *zmanim* calculations. See the documentation of
1567/// [`zmanim_calculator`] for some discussion of this
1568#[derive(Debug, Clone, Copy, PartialEq, Eq)]
1569pub enum UseElevation {
1570 /// Never use elevation
1571 No,
1572 /// Only use elevation directly for *hanetz* and *shkia*
1573 HanetzShkia,
1574 /// Always use elevation
1575 All,
1576}
1577
1578impl UseElevation {
1579 /// Convert the `UseElevation` into a `bool` for
1580 /// [`zmanim_calculator`] functions. The param
1581 /// `hanetz_or_shkia` should be `true` if the calling function is
1582 /// calculating *hanetz* or *shkia*, and `false` otherwise
1583 #[must_use]
1584 pub const fn to_bool(&self, hanetz_or_shkia: bool) -> bool {
1585 match &self {
1586 Self::No => false,
1587 Self::HanetzShkia => hanetz_or_shkia,
1588 Self::All => true,
1589 }
1590 }
1591}