This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//based on albers.js by Tom Carden https://gist.github.com/RandomEtc/476238 | |
//ex. for a 954.66669*601.46283pt SVG of contiguous US, I used: | |
// $albers = new Albers([23.0,-96.0], [29.5, 45.5]); | |
// $coords = $albers->project($lat,$long); | |
// $coords = ['x'=>$coords['x']*1315+485, 'y'=>$coords['y']*1315+654]; //scale and translate | |
class Albers{ | |
private static $origin, $parallels, $n, $c, $C, $p0, $lat0, $lng0, $phi1, $phi2; | |
private $t, $p; |