| Conditions | 1 |
| Paths | 1 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | public function __construct($lat, $lon, $distance) |
||
| 27 | { |
||
| 28 | $latInMeters = ((1 - $lat/90)*2*M_PI*6371000)/360; |
||
| 29 | $lonInMeters = (2*M_PI*6371000)/360; |
||
| 30 | $mDist = $distance * 1000; |
||
| 31 | |||
| 32 | $this->longitude = [ |
||
| 33 | ($lon - $mDist * 1/$lonInMeters), |
||
| 34 | ($lon + $mDist * 1/$lonInMeters), |
||
| 35 | ]; |
||
| 36 | |||
| 37 | $this->latitude = [ |
||
| 38 | ($lat - $mDist * 1/$latInMeters), |
||
| 39 | ($lat + $mDist * 1/$latInMeters), |
||
| 40 | ]; |
||
| 41 | } |
||
| 42 | |||
| 58 | } |