Astronomy Sensor

== Overview ==
The Astronomy Sensor is the primary tool for navigation in space. It outputs a special format of coordinates in a composite signal. Just pointing your rocket at the moon at full throttle isn't optimal in any sense (It wastes fuel and time), so using the astronomy sensor can help getting the optimal trajectory.
== The X, Y and Z component ==
The Y value indicates your distance to Earth. On earth's surface, this value is approximately 0, and on the moon, it is 1. 
The X and Z coordinates are also important, because you do not want to miss the moon. To arrive there, you need to roughly achieve the coordinates X=0, Y=1, Z=0. 
The coordinate values generated by the astronomy sensor (found in composite channels 1, 2 and 3 respectively) are similar to GPS coordinates. Because the moon is approximately 500km above Earth, you can convert from astronomy sensor coordinates to GPS coordinates that line up with Earth coordinates.
x = astronomy_x * 490196
y (altitude) = astronomy_y * 490196
z = astronomy_z * 490196
=== Calculating speed ===
You can calculate your velocity by using a delta logic gate in the Microcontroller Editor to measure the rate of change of your coordinates. Important: This results in a value measured in meters per tick. To convert to m/s, you simply need to multiply it by 60. You can use the Pythagorean theorem to measure your total velocity, rather than your per-axis velocity:
speed = sqrt(velocity_x^2+velocity_y^2+velocity_z^2)