Distance and Bearing: Difference between revisions
Content added Content deleted
(→{{header|Ruby}}: Add Ruby) |
|||
Line 1,294: | Line 1,294: | ||
closest.each do |r| |
closest.each do |r| |
||
bearing = (bearing(position,[r[:latitude], r[:longitude]])*180/PI).round % 360 |
bearing = (bearing(position,[r[:latitude], r[:longitude]])*180/PI).round % 360 |
||
puts "%-40s %-25s %-6s %12.1f %15.0f |
puts "%-40s %-25s %-6s %12.1f %15.0f" % (r.values_at(:name, :country, :ICAO, :dist) << bearing) |
||
end |
end |
||
</syntaxhighlight> |
</syntaxhighlight> |