Función Sensores pueden medir metros/kilometros recorridos?

267 views
Skip to first unread message

Jaime Andres Ramirez Tamayo

unread,
Mar 21, 2015, 12:12:09 PM3/21/15
to mitappinv...@googlegroups.com

A partir del Hablo de Colombia de de Hola, quiero saber si Es Posible Que la Función Sensores "orientación" "Ubicación", "ACELEROMETRO" me pueden Medir en metros o Kilómetros Una DISTANCIA recorrida Entre dos Puntos, tengo una Aplicación en mente y necesitaria este Parr funsion llevarla cavo un.
Si Es Posible Quisiera Saber O que alguien me oriente Como programarla, alguien si por favor me SABE colaborar Florerias, muchas gracias !!

SteveJG

unread,
Mar 21, 2015, 2:43:04 PM3/21/15
to mitappinv...@googlegroups.com
You use the LocationSensor in AI.   The orientation and accelerometer can not provide the information you need.

If the distance is not large:

  1. Rough Distance
    sqrt( (69.1 * (lat2Degrees-lat1Degrees))^2 + (53.0 * (lon2Degrees-lon1Degrees))^2 )
    You really should not be concerned with much accuracy if you are planning on using this function as you’ll easily get 10% or more distance errors. The basic idea is to take the average distance per degree longitude and latitude and use it to convert degrees to distance. If you are using miles you’d use 69.1 miles for each degree latitude and 53.0 miles for each degree longitude. 53.0 miles is an average and you can adjust this to closer match the actual distance for a degree longitude at a given latitude. But if you do that you might as well use the previous function since it is exactly doing that.

    You can use this formula if any of these conditions apply:
    – very short distances.
    – if you’re data is limited to a local area and you can use an adjusted distance for one degree longitude.
    – if 10% or more inaccuracy is sufficient for your needs.
    – for comparison of distances

This distance is in miles, you need to convert to meters/kilometers using the Math blocks.


If the distance is larger ... Google haversine formula

Both methods provide straight - line distance between two know points.

If you need turn by turn instructions, you use the Google Map API instructions https://developers.google.com/maps/documentation/javascript/tutorial   

See the Where is my car    and LocationSensor tutroial for more information:  http://appinventor.mit.edu/explore/ai2/tutorials3818.html?&page=2  

There are other ways to do this.  What you do depends on what your app must do.

Regards,
Steve
Reply all
Reply to author
Forward
0 new messages