speed Calculations


Closed Thread
Results 1 to 19 of 19

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,680


    Did you find this post helpful? Yes | No

    Default Re: speed Calculations

    1. so worst case

    max distance 4000 miles = 6437376 m
    max time = 8 days = 69120000 1/ 100's of a second

    v=(d/time)/100 (d in meters ,time in 1/100's of a second) = v in m/s
    velocity= (6437376/69120000) /100 (to two decimals) as m/s
    velocity= (6437376/69120000)*36 /1000 (to two decimals) as kph

    and using Alain's figures
    velocity= (6437376/69120000)*256 /(100*78) (to two decimals) as ft/s

    etc.....................
    just keep within the range of unsigned longs


    a better strategy would be to examine the magnitude of the time and switch to hours at a suitable size and ditto for distance switch to kilometres for larger distances. you may be able to avoid longs
    that way
    Last edited by richard; - 4th November 2014 at 03:27.

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Thumbs up Re: speed Calculations

    Quote Originally Posted by richard View Post
    a better strategy would be to examine the magnitude of the time and switch to hours at a suitable size and ditto for distance switch to kilometres for larger distances. you may be able to avoid longs
    that way
    +1000

    and moreover if only two decimals are needed for the result ...

    might be the " Arduino syndrom " ( extensive use of floats ) ???

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Similar Threads

  1. CRC Calculations
    By timmers in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 16th June 2009, 17:10
  2. clock/timer calculations
    By virolay in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 4th January 2008, 20:20
  3. Incorrect calculations... please help.
    By bearpawz in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 29th January 2007, 22:03
  4. Calculations for using faster Clocks.
    By Tissy in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 18th April 2005, 14:24
  5. timing calculations
    By scorpion in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 28th November 2004, 22:58

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts