This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* google.maps.LatLng Hijack | |
*/ | |
// $require: game/init.js | |
(function() | |
{ | |
var GLATLNG_LAT = null;//"Ud"; | |
var GLATLNG_LNG = null;//"La"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$distance = distance($src['lat'], $src['lng'], $dest['lat'], $dest['lng']); | |
$angle = getangle($src['lat'], $src['lng'], $dest['lat'], $dest['lng']); | |
$headdist = max($diststance * .95, $distance - .01); | |
$head = circle::getLatLngByAngle($src, $angle, $distance + $radius); | |
$srcleft = circle::getLatLngByAngle($src, $angle - 90, $radius); | |
$srcright = circle::getLatLngByAngle($src, $angle + 90, $radius); | |
$headleft = circle::getLatLngByAngle($srcleft, $angle, $headdist); | |
$headright = circle::getLatLngByAngle($srcright, $angle, $headdist); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function intersectPoint($line1, $angle1, $line2, $angle2) | |
{ | |
$lat1 = deg2rad($line1['lat']); | |
$lon1 = deg2rad($line1['lng']); | |
$lat2 = deg2rad($line2['lat']); | |
$lon2 = deg2rad($line2['lng']); | |
$brng13 = deg2rad($angle1); | |
$brng23 = deg2rad($angle2); | |
$dLat = $lat2-$lat1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function distance($lat1, $lng1, $lat2, $lng2, $miles = true) | |
{ | |
$pi80 = M_PI / 180; | |
$lat1 *= $pi80; | |
$lng1 *= $pi80; | |
$lat2 *= $pi80; | |
$lng2 *= $pi80; | |
$r = 6372.797; // mean radius of Earth in km |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function intersectPoint($line1start, $line1end, $line2start, $line2end) | |
//($p0_x, $p0_y, $p1_x, $p1_y, $p2_x, $p2_y, $p3_x, $p3_y) | |
{ | |
$p0_x = $line1start['lat']; | |
$p0_y = $line1start['lng']; | |
$p1_x = $line1end['lat']; | |
$p1_y = $line1end['lng']; | |
$p2_x = $line2start['lat']; | |
$p2_y = $line2start['lng']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function intersectPoint($line1start, $line1end, $line2start, $line2end) | |
//($p0_x, $p0_y, $p1_x, $p1_y, $p2_x, $p2_y, $p3_x, $p3_y) | |
{ | |
bcscale(8); | |
$p0_x = (string) $line1start['lat']; | |
$p0_y = (string) $line1start['lng']; | |
$p1_x = (string) $line1end['lat']; | |
$p1_y = (string) $line1end['lng']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$p1_x = (string) 35.705651433621; | |
$p0_x = (string) 35.723213079092; | |
$s1_x = gmp_sub($p1_x, $p0_x); | |
echo gmp_strval($s1_x); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function intersectPoint($line1start, $line1end, $line2start, $line2end) | |
{ | |
$x1 = (double) $line1start['lat']; | |
$y1 = (double) $line1start['lng']; | |
$x2 = (double) $line1end['lat']; | |
$y2 = (double) $line1end['lng']; | |
$x3 = (double) $line2start['lat']; | |
$y3 = (double) $line2start['lng']; | |
$x4 = (double) $line2end['lat']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function intersectPoint($line1start, $line1end, $line2start, $line2end) | |
{ | |
bcscale(20); | |
$x1 = (double) $line1start['lat']; | |
$y1 = (double) $line1start['lng']; | |
$x2 = (double) $line1end['lat']; | |
$y2 = (double) $line1end['lng']; | |
$x3 = (double) $line2start['lat']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(Weapons): =============== | |
Checking intersectArray | |
( | |
[0] => Array | |
( | |
[lat] => 35.700468579995 | |
[lng] => -78.645993571236 | |
) | |
[1] => Array |
OlderNewer