Skip to content

Instantly share code, notes, and snippets.

View miquels's full-sized avatar

Miquel van Smoorenburg miquels

  • XS4ALL
  • Amsterdam
View GitHub Profile
@miquels
miquels / average-geolocation.pl
Last active August 9, 2019 08:10 — forked from tlhunter/average-geolocation.js
Calculate the center/average of multiple GeoLocation coordinates
#
# Calculate the center/average of multiple GeoLocation coordinates
# Expects an array of array refs: ([lat, long], [lat, long]).
#
# @url http://stackoverflow.com/a/14231286/538646
#
use warnings;
use strict;
sub PI() { 4 * atan2(1, 1) }