Skip to content

Commit 7287a6a

Browse files
authored
getTimeAtAzimuth(double) -> getTimeAtAzimuth90Or270(double)
So far a reliable algorithm to return the time for any azimuth at any latitude has not been found. A new algorithm limited to 90° and 270° (the only ones currently needed by this library) has been found and will be implemented in the near future.
1 parent 8215fe0 commit 7287a6a

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

‎src/main/java/com/kosherjava/zmanim/AstronomicalCalendar.java‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,13 +522,19 @@ protected enum SolarEvent {
522522
}
523523

524524
/**
525-
* Return the time at a given azimuth. This often will not occur and a null will be returned.
525+
* Return the time at either an azimuth 90° (directly east) or 270° (directly west).
526+
*
526527
* @param azimuth the azimuth that you want to get the time of day for.
527528
* @return the time that the azimuth will be reached. There are cases where this azimuth will never be reached for the date and
528529
* location, and a null will be returned in that case.
529530
* @see com.kosherjava.zmanim.util.AstronomicalCalculator#getTimeAtAzimuth(LocalDate, GeoLocation, double)
531+
* @see com.kosherjava.zmanim.ComprehensiveZmanimCalendar#getSunriseOrEasternmostSolarAzimuth()
532+
* @see com.kosherjava.zmanim.ComprehensiveZmanimCalendar#getSunsetOrWesternmostSolarAzimuth()
533+
* @throws IllegalArgumentException if the azimuth is not 90° or 270°.
534+
* @todo Once a reliable implementation to get any azimuth at any date for any latitude is implemented, make this method more
535+
* generic.
530536
*/
531-
public Instant getTimeAtAzimuth(double azimuth) {
537+
public Instant getTimeAtAzimuth90Or270(double azimuth) {
532538
double rawAzimuth = getAstronomicalCalculator().getTimeAtAzimuth(getAdjustedLocalDate(), getGeoLocation(), azimuth);
533539
return getInstantFromTime(rawAzimuth, SolarEvent.NONE);
534540
}

0 commit comments

Comments
 (0)