Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jun 2003
    Posts
    92
    Thanks
    0
    Thanked 0 Times in 0 Posts

    what unit for time and distance

    I am trying to make a program where the user types in the distance travelled and the time and then it will calculate the velocity. I am wondering what unit distance and time in javascript. Is distance meters or miles? Is time seconds?

  • #2
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    Do you understand what you're asking?

    The units you use are completely arbitrary - Javascript has no concept of units.

    Velocity has units of distance/time. Whatever unit you use to measure distance and whatever unit you used to measure time go there. Javascript doesn't convert them into any other unit for you, nor does it even "know" how to unless to tell it.

  • #3
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    define your units as you like. You can use JavaScript as you use, say, multiplication table or logarithm table...:-) to operate some variables defined by yourself...

    There are some cases in witch Java Script uses pre-define time units (miliseconds), but even in this case it use the computer's clock input, and only for setting and compare the time for some dynamic applications...
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


  •  

    Posting Permissions

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