Nasal library/geo: Difference between revisions

Jump to navigation Jump to search
Save
(Start)
(Save)
Line 16: Line 16:
|text = Constructor function. Returns a <code>geo.Coord</code> instance.
|text = Constructor function. Returns a <code>geo.Coord</code> instance.
|param1 = coord
|param1 = coord
|param1text = An optional <code>geo.Coord</code> instance. If given, the returned instance will contain the values from this.
|param1text = An optional <code>geo.Coord</code> instance. If given, the returned instance will contain the values from this argument.
|example1 = var coord = geo.Coord.new();
coord.dump();
|example2 = var ac_pos = geo.aircraft_position();
var coord = geo.Coord.new(ac_pos);
coord.dump();
}}
==== set() ====
{{Nasal doc
|syntax = geo.Coord.set(coord);
|source = {{fgdata file|Nasal/geo.nas|t=Source}}
|text = Sets the coordinates. Returns the <code>geo.Coord</code> instance.
|param1 = coord
|param1text = Sets the coordinates from another <code>geo.Coord</code> instance.
|example1 = var ac_pos = geo.aircraft_position();
var coord = geo.Coord.new();
coord.set(ac_pos);
coord.dump();
}}
==== set_lat() ====
{{Nasal doc
|syntax = geo.Coord.set_lat(lat);
|source = {{fgdata file|Nasal/geo.nas|t=Source}}
|text = Sets the {{wikipedia|latitude}} coordinate. Returns the <code>geo.Coord</code> instance.
|param1 = lat
|param1text = The latitude coordinate.
|example1 = var coord = geo.Coord.new();
coord.set_lat(45);
coord.dump();
}}
==== set_lon() ====
{{Nasal doc
|syntax = geo.Coord.set_lon(lon);
|source = {{fgdata file|Nasal/geo.nas|t=Source}}
|text = Sets the {{wikipedia|longitude}} coordinate. Returns the <code>geo.Coord</code> instance.
|param1 = lon
|param1text = The longitude coordinate.
|example1 = var coord = geo.Coord.new();
coord.set_lon(90);
coord.dump();
}}
==== set_alt() ====
{{Nasal doc
|syntax = geo.Coord.set_alt(alt);
|source = {{fgdata file|Nasal/geo.nas|t=Source}}
|text = Sets the {{wikipedia|altitude}} coordinate. Returns the <code>geo.Coord</code> instance.
|param1 = alt
|param1text = The altitude coordinate. Note that this can be in either feet or metres, so make sure you convert correctly.
|example1 = var coord = geo.Coord.new();
coord.set_alt(1000);
coord.dump();
}}
==== set_latlon() ====
{{Nasal doc
|syntax = geo.Coord.set_latlon(lat, lon[, alt]);
|source = {{fgdata file|Nasal/geo.nas|t=Source}}
|text = Sets the latitude and longitude coordinates, and optionally the altitude coordinate. Returns the <code>geo.Coord</code> instance.
|param1 = lat
|param1text = The latitude coordinate.
|param2 = lon
|param2text = The longitude coordinate.
|param3 = alt
|param3text = The altitude coordinate. Note that this can be in either feet or metres, so make sure you convert correctly.
|example1 = var coord = geo.Coord.new();
coord.set_latlon(45, 90, 1000);
coord.dump();
}}
}}


Navigation menu