3v4l.org

run code in 300+ PHP versions simultaneously
<?php $name= 'TEST'; $circleLat = 19.282494; $circleLon = 166.636650; $circleRadius = 1047*1852; $circlePrecision =5; $coordinatesList = ""; // Code based on Google Earth community posting by 'ink_polaroid' // http://bbs.keyhole.com/ubb/showflat.php/Cat/0/Number/23634/an//page//vc/1 $num_points = 36; $delta_pts = 360/$num_points; // convert coordinates to radians $lat = deg2rad(floatval($circleLat)); $lon = deg2rad(floatval($circleLon)); $d = $circleRadius; $d_rad = $d/6378137; // convert dist to angular distance in radians // loop around the compass, appending coordinates of each vertex for($i=0; $i<=$num_points; $i++) { $radial = deg2rad($i*$delta_pts); $lonCircle = $d_rad*sin($radial); $latCircle = $d_rad*cos($radial); $coordinatesList .= Round(rad2deg($lon+$lonCircle),$circlePrecision).",". Round(rad2deg($lat+$latCircle),$circlePrecision).",30\n"; } print_r($coordinatesList);
Output for git.master, git.master_jit, rfc.property-hooks
166.63665,36.70122,30 169.66138,36.43659,30 172.59421,35.65074,30 175.34601,34.36756,30 177.83319,32.62601,30 179.98017,30.47904,30 181.72171,27.99186,30 183.0049,25.24005,30 183.79075,22.30722,30 184.05538,19.28249,30 183.79075,16.25776,30 183.0049,13.32494,30 181.72171,10.57313,30 179.98017,8.08595,30 177.83319,5.93897,30 175.34601,4.19743,30 172.59421,2.91424,30 169.66138,2.1284,30 166.63665,1.86377,30 163.61192,2.1284,30 160.67909,2.91424,30 157.92729,4.19743,30 155.44011,5.93897,30 153.29313,8.08595,30 151.55159,10.57313,30 150.2684,13.32494,30 149.48255,16.25776,30 149.21792,19.28249,30 149.48255,22.30722,30 150.2684,25.24005,30 151.55159,27.99186,30 153.29313,30.47904,30 155.44011,32.62601,30 157.92729,34.36756,30 160.67909,35.65074,30 163.61192,36.43659,30 166.63665,36.70122,30

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
53.72 ms | 407 KiB | 5 Q