source: trunk/inc/RadiusAssistant.inc.php

Last change on this file was 2, checked in by george, 14 years ago
  • Přidáno: Trunk revize 13719.
File size: 851 bytes
Line 
1<?php
2
3class RadiusAssistant {
4
5 var $maxLat;
6 var $minLat;
7 var $maxLong;
8 var $minLong;
9
10 function RadiusAssistant($Latitude, $Longitude, $Miles) {
11 //global $maxLat, $minLat, $maxLong, $minLong;
12 $EQUATOR_LAT_MILE = 69.172;
13 $this->maxLat = $Latitude + $Miles / $EQUATOR_LAT_MILE;
14 $this->minLat = $Latitude - ($this->maxLat - $Latitude);
15 $this->maxLong = $Longitude + $Miles / (cos($minLat * M_PI / 180) * $EQUATOR_LAT_MILE);
16 $this->minLong = $Longitude - ($this->maxLong - $Longitude);
17 }
18
19 function MaxLatitude() {
20 //return $GLOBALS["maxLat"];
21 return $this->maxLat;
22 }
23 function MinLatitude() {
24 //return $GLOBALS["minLat"];
25 return $this->minLat;
26 }
27 function MaxLongitude() {
28 //return $GLOBALS["maxLong"];
29 return $this->maxLong;
30 }
31 function MinLongitude() {
32 //return $GLOBALS["minLong"];
33 return $this->minLong;
34 }
35
36}
37
38?>
Note: See TracBrowser for help on using the repository browser.