waypoints: cleanup
parent
6df1d33b27
commit
673bcc35d5
|
|
@ -196,24 +196,13 @@ let arrow = {
|
||||||
this.waypoint.lon = lon;
|
this.waypoint.lon = lon;
|
||||||
},
|
},
|
||||||
|
|
||||||
// Calculate the bearing to the waypoint
|
|
||||||
bearingToWaypoint: function(currentPos) {
|
|
||||||
return fmt.bearing(currentPos, this.waypoint);
|
|
||||||
},
|
|
||||||
|
|
||||||
// Calculate distance to the waypoint
|
|
||||||
distanceToWaypoint: function(currentPos) {
|
|
||||||
return fmt.distance(currentPos, this.waypoint);
|
|
||||||
},
|
|
||||||
|
|
||||||
// Display function to show arrows for waypoint, north, and sun
|
// Display function to show arrows for waypoint, north, and sun
|
||||||
draw: function(currentPos) {
|
draw: function(currentPos) {
|
||||||
let currentHeading = currentPos.course;
|
let currentHeading = currentPos.course;
|
||||||
g.clear().setFont("Vector", 22).setFontAlign(0, 0);
|
g.clear().setFont("Vector", 22).setFontAlign(0, 0);
|
||||||
|
|
||||||
// Calculate bearings
|
let waypointBearing = fmt.bearing(currentPos, this.waypoint);
|
||||||
let waypointBearing = this.bearingToWaypoint(currentPos);
|
let distance = fmt.distance(currentPos, this.waypoint);
|
||||||
let distance = this.distanceToWaypoint(currentPos);
|
|
||||||
|
|
||||||
|
|
||||||
northHeading = 0;
|
northHeading = 0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue