Category: GPS

I am building an augmented reality app that needs to know when the user tilts and rolls a phone around so it can update the user interface with augmented reality elements. Corona already has the accelerometer acquisition code but now I want to display this data in human readable degrees (e.g if you were looking half way up the sky you would expect 45° and the horizon 0°)

This does not look too handy to some but this is gold in plotting the horizon and calculating far away objects with trigonometry.

Don’t forget to detect what orientation the mobile device is in (portrait, landscape, upside down portrait and upside down landscape). You will need to factor these display modes into the calculation before converting to degrees. Sometimes it is easier to just develop portrait or landscape apps (not both).

I have been searching for a solution to calculate the distance and bearing of a target gps location for a while now. This page always popped up but my brain hurt every time I tried to convert this to lua.

print("Bearing between Tamworth and Armidale: "..tonumber(GeoAngle(-31.1063157,150.9307341,-30.5143425,151.66696439999998)))print("Distance between Tamworth and Armidale: "..tonumber(GeoDistance(-31.1063157,150.9307341,-30.5143425,151.66696439999998)).."km")