20,741
edits
m (→Orbital Map: http://forum.flightgear.org/viewtopic.php?f=75&t=25480&p=239076#p238962) |
m (→Orbital Map: begin generalization: get rid of magic numbers (untested)) |
||
Line 132: | Line 132: | ||
<syntaxhighlight lang="nasal">var sym_shuttle = {}; | <syntaxhighlight lang="nasal">var sym_shuttle = {}; | ||
var sym_landing_site = {}; | var sym_landing_site = {}; | ||
var (width,height) = (800,400); | |||
var graph = {}; | var graph = {}; | ||
var samples = []; | var samples = []; | ||
Line 165: | Line 168: | ||
var lat_to_y = func (lat) { | var lat_to_y = func (lat) { | ||
return | return height/2 - lat /90. * height/2; | ||
} | } | ||
Line 171: | Line 174: | ||
var lon_to_x = func (lon) { | var lon_to_x = func (lon) { | ||
return | return width/2 + lon /180. * width/2; | ||
} | } | ||
Line 177: | Line 180: | ||
var create_map = func { | var create_map = func { | ||
var window = canvas.Window.new([ | var window = canvas.Window.new([width,height],"dialog").set("title", "Trajectory Map"); | ||
# we need to explicitly re-define this to get a handle to stop the update loop | # we need to explicitly re-define this to get a handle to stop the update loop | ||
Line 199: | Line 202: | ||
.setFile( path ) | .setFile( path ) | ||
.setTranslation(0,0) | .setTranslation(0,0) | ||
.setSize( | .setSize(width,height); | ||
sym_shuttle = mapCanvas.createGroup(); | sym_shuttle = mapCanvas.createGroup(); | ||
canvas.parsesvg(sym_shuttle, "/Nasal/canvas/map/Images/boeingAirplane.svg"); | canvas.parsesvg(sym_shuttle, "/Nasal/canvas/map/Images/boeingAirplane.svg"); |