Skip to content

Instantly share code, notes, and snippets.

@shadda
Last active October 19, 2015 03:00
Show Gist options
  • Save shadda/2b5d27e94add06cad212 to your computer and use it in GitHub Desktop.
Save shadda/2b5d27e94add06cad212 to your computer and use it in GitHub Desktop.
<?php
$rows = range(0, 512);
$numRows = count($rows);
$degreesLatitude = 80;
$startLatitude = -90.0;
$factor = $degreesLatitude / $numRows;
array_walk($rows, function(&$value, $key) use ($startLatitude, $factor)
{
$value = $startLatitude + ($value * $factor);
});
var_dump($rows);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment