Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Math Help How many seconds from my turn am I
Message
De
22/02/2013 16:04:06
 
 
À
22/02/2013 11:56:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01566768
Message ID:
01566793
Vues:
77
This message has been marked as a message which has helped to the initial question of the thread.
>Any math experts that can validate this (Just like the old school questions)?
>
>A mile has 5,280 feet, and an hour has 3,600 seconds, so 60 miles per hour is:
>60 x 5,280 / 3,600 = 88 fps
>(60 mph = 88 fps )
>
>How to determine how many seconds from your destination you are (example driving in a car and you are 1500' from your next turn):
>
>1. Determine distance to travel (1500 feet)
>2. Determine speed
>3. Determine feet per second
>4. Determine how many seconds from the destination you are
>
>Let’s say you are 1500 feet from your turn and you are going 30 mph. You want to be notified 7 seconds from the turn.
> 30 x 5280 / 3600 = 44 feet per second
> 1500 feet / 44 feet per second = you are 34.090909 seconds from the turn
>
>I can process this every second until I am 7 seconds out. Is that the best method (assuming you could speed up or slow down it would need to be checked/computed every second)
>
>Looks right to me, but can anyone verify that is accurate?

Yes, that's correct, and that's the way I'd do it, too.

Your assumption about varying speeds is also valid and has a few consequences:

1. Suppose you travel fast, and get the 7-second warning. Before reaching the turn, you slow down or stop for a bit, then start again at a slow speed. You could get another 7-second warning. In fact you could get an arbitrary number of 7-second warnings depending on how you drive. You will probably want to implement a latch so you only get warned once.

2. You will probably want to issue a warning when you get within X distance of the turn, regardless of how long it's projected you'll take to get there. I believe that's what most GPS units that offer driving directions do - they show or announce distance to the next waypoint. Again, you'll only want to issue one warning per waypoint.

3. You could combine the two methods, maybe that's what you're trying to do i.e. calculate a reasonable time to issue a warning of remaining distance to the next waypoint.

Also make sure you have a high enough polling frequency. In general, your polling frequency should be at least twice as high as the time resolution you're trying to achieve. For example, suppose a warning at 7 seconds +/- 1 second is "good enough". Then your polling frequency should be 0.5 seconds or shorter.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform