update/destination presentation
This commit is contained in:
5 files changed
+12
-12
No files matched your search
+2
-2
@@ -4,8 +4,8 @@ module.exports = {
|
||||
let distance = parseFloat(Math.sqrt(Math.pow(delta[0], 2) + Math.pow(delta[1], 2)).toFixed(0));
|
||||
let thetat = Math.round(Math.atan2(delta[0], delta[1]) / Math.PI * 180);
|
||||
let theta = (thetat < 0) ? (360 + thetat) : thetat;
|
||||
let compass = ["S", "S.SW", "SW", "W.SW", "W", "W.NW", "NW", "N.NW", "N", "N.NE", "NE", "E.NE", "E", "E.SE", "SE", "S.SE", "S"];
|
||||
let dir = compass[Math.round(theta / 22.5)];
|
||||
let compass = ["S", "SW", "W", "NW", "N", "N by NE", "NE", "E", "SE", "S"];
|
||||
let dir = compass[Math.round(theta / 45)];
|
||||
|
||||
return {distance, theta, dir}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user