I18N_Arabic

# Source for file Salat.php

Documentation is available at Salat.php

1. <?php
2. /**
3. * ----------------------------------------------------------------------
4. *
5. * Copyright (c) 2006-2016 Khaled Al-Sham'aa
6. *
7. * http://www.ar-php.org
8. *
9. * PHP Version 5
10. *
11. * ----------------------------------------------------------------------
12. *
13. * LICENSE
14. *
15. * This program is open source product; you can redistribute it and/or
16. * modify it under the terms of the GNU Lesser General Public License (LGPL)
17. * as published by the Free Software Foundation; either version 3
18. * of the License, or (at your option) any later version.
19. *
20. * This program is distributed in the hope that it will be useful,
21. * but WITHOUT ANY WARRANTY; without even the implied warranty of
22. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23. * GNU Lesser General Public License for more details.
24. *
25. * You should have received a copy of the GNU Lesser General Public License
26. * along with this program. If not, see <http://www.gnu.org/licenses/lgpl.txt>.
27. *
28. * ----------------------------------------------------------------------
29. *
30. * Class Name: Muslim Prayer Times
31. *
32. * Filename: Salat.php
33. *
34. * Original Author(s): Khaled Al-Sham'aa <khaled@ar-php.org>
35. *
36. * Purpose: The five Islamic prayers are named Fajr, Zuhr, Asr, Maghrib
37. * and Isha. The timing of these five prayers varies from place
38. * to place and from day to day. It is obligatory for Muslims
39. * to perform these prayers at the correct time.
40. *
41. * ----------------------------------------------------------------------
42. *
43. * Source: http://qasweb.org/qasforum/index.php?showtopic=177&st=0
44. * By: Mohamad Magdy <mohamad_magdy_egy@hotmail.com>
45. *
46. * ----------------------------------------------------------------------
47. *
48. * Muslim Prayer Times
49. *
50. * Using this PHP Class you can calculate the time of Muslim prayer
51. * according to the geographic location.
52. *
53. * The five Islamic prayers are named Fajr, Zuhr, Asr, Maghrib and Isha. The timing
54. * of these five prayers varies from place to place and from day to day. It is
55. * obligatory for Muslims to perform these prayers at the correct time.
56. *
57. * The prayer times for any given location on earth may be determined mathematically
58. * if the latitude and longitude of the location are known. However, the theoretical
59. * determination of prayer times is a lengthy process. Much of this tedium may be
60. * alleviated by using computer programs.
61. *
62. * Definition of prayer times
63. *
64. * - FAJR starts with the dawn or morning twilight. Fajr ends just before sunrise.
65. * - ZUHR begins after midday when the trailing limb of the sun has passed the
66. * meridian. For convenience, many published prayer timetables add five minutes to
67. * mid-day (zawal) to obtain the start of Zuhr. Zuhr ends at the start of Asr time.
68. * - The timing of ASR depends on the length of the shadow cast by an object.
69. * According to the Shafi school of jurisprudence, Asr begins when the length of
70. * the shadow of an object exceeds the length of the object. According to the
71. * Hanafi school of jurisprudence, Asr begins when the length of the shadow
72. * exceeds TWICE the length of the object. In both cases, the minimum length of
73. * shadow (which occurs when the sun passes the meridian) is subtracted from the
74. * length of the shadow before comparing it with the length of the object.
75. * - MAGHRIB begins at sunset and ends at the start of isha.
76. * - ISHA starts after dusk when the evening twilight disappears.
77. *
78. * Example:
79. * <code>
80. * date_default_timezone_set('UTC');
81. *
82. * include('./I18N/Arabic.php');
83. * $obj = new I18N_Arabic('Salat');
84. *
85. * $obj->setLocation(33.513,36.292,2);
86. * $obj->setDate(date('j'), date('n'), date('Y'));
87. *
88. * $times = $obj->getPrayTime();
89. *
90. * echo '<b>Damascus, Syria</b><br />';
91. * echo date('l F j, Y').'<br /><br />';
92. *
93. * echo "<b class=hilight>Imsak:</b> {$times[8]}<br />";
94. * echo "<b class=hilight>Fajr:</b> {$times[0]}<br />";
95. * echo "<b class=hilight>Sunrise:</b> {$times[1]}<br />";
96. * echo "<b class=hilight>Zuhr:</b> {$times[2]}<br />";
97. * echo "<b class=hilight>Asr:</b> {$times[3]}<br />";
98. * echo "<b class=hilight>Sunset:</b> {$times[6]}<br />";
99. * echo "<b class=hilight>Maghrib:</b> {$times[4]}<br />";
100. * echo "<b class=hilight>Isha:</b> {$times[5]}<br />";
101. * echo "<b class=hilight>Midnight:</b> {$times[7]}<br />";
102. * </code>
103. *
104. * Qibla Determination Methods - Basic Spherical Trigonometric Formula
105. *
106. * The problem of qibla determination has a simple formulation in spherical
107. * trigonometry. A is a given location, K is the Ka'ba, and N is the North Pole.
108. * The great circle arcs AN and KN are along the meridians through A and K,
109. * respectively, and both point to the north. The qibla is along the great circle
110. * arc AK. The spherical angle q = NAK is the angle at A from the north direction
111. * AN to the direction AK towards the Ka'ba, and so q is the qibla bearing to be
112. * computed. Let F and L be the latitude and longitude of A, and FK and LK be
113. * the latitude and longitude of K (the Ka'ba). If all angles and arc lengths
114. * are measured in degrees, then it is seen that the arcs AN and KN are of measure
115. * 90 - F and 90 - FK, respectively. Also, the angle ANK between the meridians
116. * of K and A equals the difference between the longitudes of A and K, that is,
117. * LK - L, no matter what the prime meridian is. Here we are given two sides and
118. * the included angle of a spherical triangle, and it is required to determine one
119. * other angle. One of the simplest solutions is given by the formula:
120. * <pre>
121. * -1 sin(LK - L)
122. * q = tan ------------------------------------------
123. * cos F tan FK - sin F cos(LK - L)
124. * </pre>
125. * In this Equation, the sign of the input quantities are assumed as follows:
126. * latitudes are positive if north, negative if south; longitudes are positive
127. * if east, negative if west. The quadrant of q is assumed to be so selected
128. * that sin q and cos q have the same sign as the numerator and denominator of
129. * this Equation. With these conventions, q will be positive for bearings east
130. * of north, negative for bearings west of north.
131. *
132. * Reference:
133. * The Correct Qibla, S. Kamal Abdali <k.abdali@acm.org>
134. * PDF version in http://www.patriot.net/users/abdali/ftp/qibla.pdf
135. *
136. * Example:
137. * <code>
138. * date_default_timezone_set('UTC');
139. *
140. * include('./I18N/Arabic.php');
141. * $obj = new I18N_Arabic('Salat');
142. *
143. * $obj->setLocation(33.513,36.292,2);
144. *
145. * $direction = $obj->getQibla();
146. * echo "<b>Qibla Direction (from the north direction):</b> $direction<br />";
147. * </code>
148. *
149. * @category I18N
150. * @package I18N_Arabic
151. * @author Khaled Al-Sham'aa <khaled@ar-php.org>
152. * @copyright 2006-2016 Khaled Al-Sham'aa
153. *
154. * @license LGPL <http://www.gnu.org/licenses/lgpl.txt>
155. * @link http://www.ar-php.org
156. */
158. /**
159. * This PHP class calculate the time of Muslim prayer according to the geographic
160. * location.
161. *
162. * @category I18N
163. * @package I18N_Arabic
164. * @author Khaled Al-Sham'aa <khaled@ar-php.org>
165. * @copyright 2006-2016 Khaled Al-Sham'aa
166. *
167. * @license LGPL <http://www.gnu.org/licenses/lgpl.txt>
168. * @link http://www.ar-php.org
169. */
170. class I18N_Arabic_Salat
171. {
172. /**
173. * السنة
174. * @ignore
175. */
176. protected $year = 1975;
178. /**
179. * الشهر
180. * @ignore
181. */
182. protected $month = 8;
184. /**
185. * اليوم
186. * @ignore
187. */
188. protected $day = 2;
190. /**
191. * فرق التوقيت العالمى
192. * @ignore
193. */
194. protected $zone = 2;
196. /**
197. * خط الطول الجغرافى للمكان
198. * @ignore
199. */
200. protected $long = 37.15861;
202. /**
203. * خط العرض الجغرافى
204. * @ignore
205. */
206. protected $lat = 36.20278;
208. /**
209. * الارتفاع عن سطح البحر
210. * @ignore
211. */
212. protected $elevation = 0;
214. /**
215. * زاوية الشروق والغروب
216. * @ignore
217. */
218. protected $AB2 = -0.833333;
220. /**
221. * زاوية العشاء
222. * @ignore
223. */
224. protected $AG2 = -18;
226. /**
227. * زاوية الفجر
228. * @ignore
229. */
230. protected $AJ2 = -18;
232. /**
233. * المذهب
234. * @ignore
235. */
236. protected $school = 'Shafi';
238. /**
239. * الطائفة
240. * @ignore
241. */
242. protected $view = 'Sunni';
244. /**
245. * Loads initialize values
246. *
247. * @ignore
248. */
249. public function __construct()
250. {
251. }
253. /**
254. * Setting date of day for Salat calculation
255. *
256. * @param integer $m Month of date you want to calculate Salat in
257. * @param integer $d Day of date you want to calculate Salat in
258. * @param integer $y Year (four digits) of date you want to calculate Salat in
259. *
260. * @return object $this to build a fluent interface
261. * @author Khaled Al-Sham'aa <khaled@ar-php.org>
262. */
263. public function setDate($m = 8, $d = 2, $y = 1975)
264. {
265. if (is_numeric($y) && $y > 0 && $y < 3000) {
266. $this->year = floor($y);
267. }
269. if (is_numeric($m) && $m >= 1 && $m <= 12) {
270. $this->month = floor($m);
271. }
273. if (is_numeric($d) && $d >= 1 && $d <= 31) {
274. $this->day = floor($d);
275. }
277. return $this;
278. }
280. /**
281. * Setting location information for Salat calculation
282. *
283. * @param decimal $l1 Latitude of location you want to calculate Salat time in
284. * @param decimal $l2 Longitude of location you want to calculate Salat time in
285. * @param integer $z Time Zone, offset from UTC (see also Greenwich Mean Time)
286. * @param integer $e Elevation, it is the observer's height in meters.
287. *
288. * @return object $this to build a fluent interface
289. * @author Khaled Al-Sham'aa <khaled@ar-php.org>
290. */
291. public function setLocation($l1 = 36.20278, $l2 = 37.15861, $z = 2, $e = 0)
292. {
293. if (is_numeric($l1) && $l1 >= -180 && $l1 <= 180) {
294. $this->lat = $l1;
295. }
297. if (is_numeric($l2) && $l2 >= -180 && $l2 <= 180) {
298. $this->long = $l2;
299. }
301. if (is_numeric($z) && $z >= -12 && $z <= 12) {
302. $this->zone = floor($z);
303. }
305. if (is_numeric($e)) {
306. $this->elevation = $e;
307. }
309. return $this;
310. }
312. /**
313. * Setting rest of Salat calculation configuration
314. *
315. * Convention Fajr Angle Isha Angle
316. *
317. * Muslim World League -18 -17
318. *
319. * Islamic Society of North America (ISNA) -15 -15
320. *
321. * Egyptian General Authority of Survey -19.5 -17.5
322. *
323. * Umm al-Qura University, Makkah -18.5
324. * Isha 90 min after Maghrib, 120 min during Ramadan
325. *
326. * University of Islamic Sciences, Karachi -18 -18
327. *
328. * Institute of Geophysics, University of Tehran -17.7 -14(*)
329. *
330. * Shia Ithna Ashari, Leva Research Institute, Qum -16 -14
331. *
332. * (*) Isha angle is not explicitly defined in Tehran method
333. * Fajr Angle = $fajrArc, Isha Angle = $ishaArc
334. *
335. * - حزب العلماء في لندن لدول
336. * أوروبا في خطوط عرض تزيد على 48
337. *
338. * $ishaArc = -17
339. * $fajrArc = -17
340. *
341. * @param string $sch [Shafi|Hanafi] to define Muslims Salat
342. * calculation method (affect Asr time)
343. * @param decimal $sunriseArc Sun rise arc (default value is -0.833333)
344. * @param decimal $ishaArc Isha arc (default value is -18)
345. * @param decimal $fajrArc Fajr arc (default value is -18)
346. * @param string $view [Sunni|Shia] to define Muslims Salat calculation
347. * method (affect Maghrib and Midnight time)
348. *
349. * @return object $this to build a fluent interface
350. * @author Khaled Al-Sham'aa <khaled@ar-php.org>
351. */
352. public function setConf(
353. $sch = 'Shafi', $sunriseArc = -0.833333, $ishaArc = -17.5,
354. $fajrArc = -19.5, $view = 'Sunni'
355. ) {
356. $sch = ucfirst($sch);
358. if ($sch == 'Shafi' || $sch == 'Hanafi') {
359. $this->school = $sch;
360. }
362. if (is_numeric($sunriseArc) && $sunriseArc >= -180 && $sunriseArc <= 180) {
363. $this->AB2 = $sunriseArc;
364. }
366. if (is_numeric($ishaArc) && $ishaArc >= -180 && $ishaArc <= 180) {
367. $this->AG2 = $ishaArc;
368. }
370. if (is_numeric($fajrArc) && $fajrArc >= -180 && $fajrArc <= 180) {
371. $this->AJ2 = $fajrArc;
372. }
374. if ($view == 'Sunni' || $view == 'Shia') {
375. $this->view = $view;
376. }
378. return $this;
379. }
381. /**
382. * Alias for getPrayTime2 method
383. *
384. * @return array of Salat times + sun rise in the following format
385. * hh:mm where hh is the hour in local format and 24 mode
386. * mm is minutes with leading zero to be 2 digits always
387. * array items is [$Fajr, $Sunrise, $Dhuhr, $Asr, $Maghrib,
388. * $Isha, $Sunset, $Midnight, $Imsak, array $timestamps]
389. * @author Khaled Al-Sham'aa <khaled@ar-php.org>
390. * @author Hamid Zarrabi-Zadeh <zarrabi@scs.carleton.ca>
391. * @source http://praytimes.org/calculation
392. */
393. public function getPrayTime()
394. {
395. $prayTime = $this->getPrayTime2();
397. return $prayTime;
398. }
400. /**
401. * Calculate Salat times for the date set in setSalatDate methode, and
402. * location set in setSalatLocation.
403. *
404. * @return array of Salat times + sun rise in the following format
405. * hh:mm where hh is the hour in local format and 24 mode
406. * mm is minutes with leading zero to be 2 digits always
407. * array items is [$Fajr, $Sunrise, $Dhuhr, $Asr, $Maghrib,
408. * $Isha, $Sunset, $Midnight, $Imsak, array $timestamps]
409. * @author Khaled Al-Sham'aa <khaled@ar-php.org>
410. * @author Hamid Zarrabi-Zadeh <zarrabi@scs.carleton.ca>
411. * @source http://praytimes.org/calculation
412. */
413. public function getPrayTime2()
414. {
415. $unixtimestamp = mktime(0, 0, 0, $this->month, $this->day, $this->year);
417. // Calculate Julian date
418. if ($this->month <= 2) {
419. $year = $this->year - 1;
420. $month = $this->month + 12;
421. } else {
422. $year = $this->year;
423. $month = $this->month;
424. }
426. $A = floor($year / 100);
427. $B = 2 - $A + floor($A / 4);
429. $jd = floor(365.25 * ($year + 4716)) + floor(30.6001 * ($month + 1))
430. + $this->day + $B - 1524.5;
432. // The following algorithm from U.S. Naval Observatory computes the
433. // Sun's angular coordinates to an accuracy of about 1 arcminute within
434. // two centuries of 2000.
435. $d = $jd - 2451545.0; // jd is the given Julian date
437. // The following algorithm from U.S. Naval Observatory computes the Sun's
438. // angular coordinates to an accuracy of about 1 arcminute within two
439. // centuries of 2000
440. // http://aa.usno.navy.mil/faq/docs/SunApprox.php
441. // Note: mod % in PHP ignore decimels!
442. $g = 357.529 + 0.98560028 * $d;
443. $g = $g % 360 + ($g - ceil($g) + 1);
445. $q = 280.459 + 0.98564736 * $d;
446. $q = $q % 360 + ($q - ceil($q) + 1);
448. $L = $q + 1.915 * sin(deg2rad($g)) + 0.020 * sin(deg2rad(2 * $g));
449. $L = $L % 360 + ($L - ceil($L) + 1);
451. $R = 1.00014 - 0.01671 * cos(deg2rad($g)) - 0.00014 * cos(deg2rad(2 * $g));
452. $e = 23.439 - 0.00000036 * $d;
454. $RA = rad2deg(atan2(cos(deg2rad($e))* sin(deg2rad($L)), cos(deg2rad($L))))
455. / 15;
457. if ($RA < 0) {
458. $RA = 24 + $RA;
459. }
461. // The declination of the Sun is the angle between the rays of the sun and
462. // the plane of the earth equator. The declination of the Sun changes
463. // continuously throughout the year. This is a consequence of the Earth's
464. // tilt, i.e. the difference in its rotational and revolutionary axes.
465. // declination of the Sun
466. $D = rad2deg(asin(sin(deg2rad($e))* sin(deg2rad($L))));
468. // The equation of time is the difference between time as read from sundial
469. // and a clock. It results from an apparent irregular movement of the Sun
470. // caused by a combination of the obliquity of the Earth's rotation axis
471. // and the eccentricity of its orbit. The sundial can be ahead (fast) by
472. // as much as 16 min 33 s (around November 3) or fall behind by as much as
473. // 14 min 6 s (around February 12), as shown in the following graph:
474. // http://en.wikipedia.org/wiki/File:Equation_of_time.png
475. $EqT = ($q/15) - $RA; // equation of time
477. // Dhuhr
478. // When the Sun begins to decline after reaching its highest point in the sky
479. $Dhuhr = 12 + $this->zone - ($this->long/15) - $EqT;
480. if ($Dhuhr < 0) {
481. $Dhuhr = 24 + $Dhuhr;
482. }
484. // Sunrise & Sunset
485. // If the observer's location is higher than the surrounding terrain, we
486. // can consider this elevation into consideration by increasing the above
487. // constant 0.833 by 0.0347 × sqrt(elevation), where elevation is the
488. // observer's height in meters.
489. $alpha = 0.833 + 0.0347 * sqrt($this->elevation);
490. $n = -1 * sin(deg2rad($alpha)) - sin(deg2rad($this->lat)) * sin(deg2rad($D));
491. $d = cos(deg2rad($this->lat)) * cos(deg2rad($D));
493. // date_sun_info Returns an array with information about sunset/sunrise
494. // and twilight begin/end
495. $Sunrise = $Dhuhr - (1/15) * rad2deg(acos($n / $d));
496. $Sunset = $Dhuhr + (1/15) * rad2deg(acos($n / $d));
498. // Fajr & Isha
499. // Imsak: The time to stop eating Sahur (for fasting), slightly before Fajr.
500. // Fajr: When the sky begins to lighten (dawn).
501. // Isha: The time at which darkness falls and there is no scattered light
502. // in the sky.
503. $n = -1 * sin(deg2rad(abs($this->AJ2))) - sin(deg2rad($this->lat))
504. * sin(deg2rad($D));
505. $Fajr = $Dhuhr - (1/15) * rad2deg(acos($n / $d));
506. $Imsak = $Fajr - (10/60);
508. $n = -1 * sin(deg2rad(abs($this->AG2))) - sin(deg2rad($this->lat))
509. * sin(deg2rad($D));
510. $Isha = $Dhuhr + (1/15) * rad2deg(acos($n / $d));
512. // Asr
513. // The following formula computes the time difference between the mid-day
514. // and the time at which the object's shadow equals t times the length of
515. // the object itself plus the length of that object's shadow at noon
516. if ($this->school == 'Shafi') {
517. $n = sin(atan(1/(1 + tan(deg2rad($this->lat - $D)))))
518. - sin(deg2rad($this->lat)) * sin(deg2rad($D));
519. } else {
520. $n = sin(atan(1/(2 + tan(deg2rad($this->lat - $D)))))
521. - sin(deg2rad($this->lat)) * sin(deg2rad($D));
522. }
523. $Asr = $Dhuhr + (1/15) * rad2deg(acos($n / $d));
525. // Maghrib
526. // In the Sunni's point of view, the time for Maghrib prayer begins once
527. // the Sun has completely set beneath the horizon, that is, Maghrib = Sunset
528. // (some calculators suggest 1 to 3 minutes after Sunset for precaution)
529. $MaghribSunni = $Sunset + 2/60;
531. // In the Shia's view, however, the dominant opinion is that as long as
532. // the redness in the eastern sky appearing after sunset has not passed
533. // overhead, Maghrib prayer should not be performed.
534. $n = -1 * sin(deg2rad(4)) - sin(deg2rad($this->lat)) * sin(deg2rad($D));
535. $MaghribShia = $Dhuhr + (1/15) * rad2deg(acos($n / $d));
537. if ($this->view == 'Sunni') {
538. $Maghrib = $MaghribSunni;
539. } else {
540. $Maghrib = $MaghribShia;
541. }
543. // Midnight
544. // Midnight is generally calculated as the mean time from Sunset to Sunrise
545. $MidnightSunni = $Sunset + 0.5 * ($Sunrise - $Sunset);
546. if ($MidnightSunni > 12) {
547. $MidnightSunni = $MidnightSunni - 12;
548. }
550. // In Shia point of view, the juridical midnight (the ending time for
551. // performing Isha prayer) is the mean time from Sunset to Fajr
552. $MidnightShia = 0.5 * ($Fajr - $Sunset);
553. if ($MidnightShia > 12) {
554. $MidnightShia = $MidnightShia - 12;
555. }
557. if ($this->view == 'Sunni') {
558. $Midnight = $MidnightSunni;
559. } else {
560. $Midnight = $MidnightShia;
561. }
563. // Result.ThlthAkhir:= Result.Fajr-(24-Result.Maghrib + Result.Fajr)/3;
564. // Result.Doha := Result.Sunrise+(15/60);
565. // if isRamadan then (Um-Al-Qura calendar)
566. // Result.Isha := Result.Maghrib+2
567. // else Result.Isha := Result.Maghrib+1.5;
569. $times = array($Fajr, $Sunrise, $Dhuhr, $Asr, $Maghrib, $Isha, $Sunset,
570. $Midnight, $Imsak);
572. // Convert number after the decimal point into minutes
573. foreach ($times as $index => $time) {
574. $hours = floor($time);
575. $minutes = round(($time - $hours) * 60);
577. if ($minutes < 10) {
578. $minutes = "0$minutes";
579. }
581. $times[$index] = "$hours:$minutes";
583. $times[9][$index] = $unixtimestamp + 3600 * $hours + 60 * $minutes;
585. if ($index == 7 && $hours < 6) {
586. $times[9][$index] += 24 * 3600;
587. }
588. }
590. return $times;
591. }
593. /**
594. * Determine Qibla direction using basic spherical trigonometric formula
595. *
596. * @return float Qibla Direction (from the north direction) in degrees
597. * @author Khaled Al-Sham'aa <khaled@ar-php.org>
598. * @author S. Kamal Abdali <k.abdali@acm.org>
599. * @source http://www.patriot.net/users/abdali/ftp/qibla.pdf
600. */
601. public function getQibla ()
602. {
603. // The geographical coordinates of the Ka'ba
604. $K_latitude = 21.423333;
605. $K_longitude = 39.823333;
607. $latitude = $this->lat;
608. $longitude = $this->long;
610. $numerator = sin(deg2rad($K_longitude - $longitude));
611. $denominator = (cos(deg2rad($latitude)) * tan(deg2rad($K_latitude))) -
612. (sin(deg2rad($latitude))
613. * cos(deg2rad($K_longitude - $longitude)));
615. $q = atan($numerator / $denominator);
616. $q = rad2deg($q);
618. if ($this->lat > 21.423333) {
619. $q += 180;
620. }
622. return $q;
623. }
625. /**
626. * Convert coordinates presented in degrees, minutes and seconds
627. * (i.e. 12°34'56"S formula) into usual float number in degree unit scale
628. * (i.e. -12.5822 value)
629. *
630. * @param string $value Coordinate presented in degrees, minutes and seconds
631. * (i.e. 12°34'56"S formula)
632. *
633. * @return float Equivalent float number in degree unit scale
634. * (i.e. -12.5822 value)
635. * @author Khaled Al-Sham'aa <khaled@ar-php.org>
636. */
637. public function coordinate2deg ($value)
638. {
639. $pattern = "/(\d{1,2})°((\d{1,2})')?((\d{1,2})\")?([NSEW])/i";
641. preg_match($pattern, $value, $matches);
643. $degree = $matches[1] + ($matches[3] / 60) + ($matches[5] /3600);
645. $direction = strtoupper($matches[6]);
647. if ($direction == 'S' || $direction == 'W') {
648. $degree = -1 * $degree;
649. }
651. return $degree;
652. }
653. }

Documentation generated on Fri, 01 Jan 2016 10:26:22 +0200 by phpDocumentor 1.4.0