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
function fieldSorterOptimized(fields) { | |
var dir = [], i, l = fields.length; | |
fields = fields.map(function(o, i) { | |
if (o[0] === "-") { | |
dir[i] = -1; | |
o = o.substring(1); | |
} else { | |
dir[i] = 1; | |
} | |
return o; |
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
getDistanceFromLatLonInM(lat1, lon1, lat2, lon2) { | |
var deg2rad = deg => deg * 0.017453293; | |
var a = | |
Math.pow(Math.sin(deg2rad(lat2 - lat1) / 2), 2) + | |
Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) * | |
Math.pow(Math.sin(deg2rad(lon2 - lon1) / 2), 2); | |
return 12742000 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); | |
} |
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
<!DOCTYPE html> | |
<div id="app"></div> | |
<script src="https://code.createjs.com/1.0.0/tweenjs.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/pixi.js/5.2.4/pixi.min.js"></script> | |
<script> | |
var app = new PIXI.Application({ | |
width: window.innerWidth, | |
height: window.innerHeight, | |
backgroundColor: 0x003300, | |
resolution: window.devicePixelRatio || 1, |