NAME - Calculations using haversine formula


  use Haversine;
  my $degrees   = recalculate_coordinate([51, 12, 0], 'deg');
  my $radians   = recalculate_coordinate([51, 12, 0], 'rad');
  my $km  = points2distance($start, $end);
  my $degrees  = azimuth($start, $end, 'deg');

recalculate_coordinate($location, $as)

Convert a tupe of (degrees, minutes, seconds) to a normal form.


An arrayref of three components: degrees, minutes, seconds.


Return value type. Can be specified as 'deg', 'min', 'sec' or 'rad'; default return value is a proper coordinate tuple.

points2distance($start, $end)

Calculate distance (in kilometers) between two points given as (lat, long) pairs based on Haversine formula ( Implementation inspired by JavaScript implementation from

Accepts coordinates as tuples (deg, min, sec), but coordinates can be given in any form - e.g. can specify only minutes: (0, 3133.9333, 0) is interpreted as (52.0, 13.0, 55.998000000008687) which, not accidentally, is the latitude of Warsaw, Poland.

azimuth($start, $end)

Calculate azimuth (bearing) of one point from another given as (lat, long) pairs based on Haversine formula

elevation($ground, $star)

Calculate the elevation of a star as seen from a point on the ground. 'star' is the declination and hour angle (lat, long) of the star, 'ground' is the (lat,long) of the ground point.

The elevation is just the complement of the angular distance between the two ground points. We assume that the star is at infinity. Not quite true for the sun or moon.


Raphael Mankin, <rapmankin at>


Please report any bugs or feature requests to bug-datetime-event-jewish at, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


You can find documentation for this module with the perldoc command.

    perldoc DateTime::Event::Jewish

You can also look for information at:



Copyright 2010 Raphael Mankin.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See for more information.