Blograby

The Speed Property

We are all familiar with a car speedometer, which tells you how fast you are driving. Although not nearly as precise, geolocationEvent has a speed property which you can use in some applications. You can imagine an application for parasailing, parachuting, or skiing, or if you prefer to remain on the ground, a measuring tool for a remotecontrolled toy.

The speed is returned in meters/second. It is a good unit for small-distance measurement. To convert to kilometers/hour, use:

event.speed * 3.6;

If you are not familiar with the metric system, convert the speed to feet/second as follows:

event.speed * 3.2808399;

To convert to miles/hour, use:

event.speed * 2.23693629; // or (event.speed*3600)/1609.344

Geolocation has inspired the development of many kinds of applications. Here are just a few:

Exit mobile version