calculate car speed (mph) using speed of light

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Oct 2007
Posts: 7
Reputation: pyramid is an unknown quantity at this point 
Solved Threads: 0
pyramid pyramid is offline Offline
Newbie Poster

calculate car speed (mph) using speed of light

 
0
  #1
Oct 22nd, 2007
I need to write two functions to calculate the speed and the $fine for over speeding. The formula I need to use is: V = c * (W0 – W1) / W0

I wrote the function to calculate the speed, but the results are incorrect, using the formulas below.

V = speed
C = speed of light (669,600,000 miles per hour)
W0 = wavelength of red light (.533 microns)
W1 = wavelength of green light (.674 microns)

V = 669600000 * (.674 - .533 ) / .674


The formula is correct, except that the values of microns are incorrect. The assigned value (.533 & .674) needs to be converted into miles, but even when I did the conversion, the results are still not correct.

.533 microns converted to miles per hour = 3.311908
.674 microns converted to miles per hour = 4.188042

I would appreciate if someone can tell me what type of conversion I need for the microns, I would greatly appreciate it.

Thanks.
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 1,429
Reputation: Nichito is an unknown quantity at this point 
Solved Threads: 30
Featured Poster
Nichito's Avatar
Nichito Nichito is offline Offline
Nearly a Posting Virtuoso

Re: calculate car speed (mph) using speed of light

 
0
  #2
Oct 22nd, 2007
if 1 micron is 1/1000000000 of a km, that means 1 micron pero hour is 1/60000000000 km/hour... in miles, that is 1.6/60000000000 mi/hour, so your conversion should be .533*1.6/60000000000 for red light, and .674 * 1.6/60000000000 for green light...
-->sometimes i wanna take my toaster in a bath<--
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 62
Reputation: Ptolemy is an unknown quantity at this point 
Solved Threads: 8
Ptolemy's Avatar
Ptolemy Ptolemy is offline Offline
Junior Poster in Training

Re: calculate car speed (mph) using speed of light

 
-1
  #3
Oct 22nd, 2007
>.533 microns converted to miles per hour = 3.311908
>.674 microns converted to miles per hour = 4.188042
Well, first, you need to remove the "per hour" part of that. The conversion is strictly distance, not distance over time. Second, you're neglecting to include the exponent in the miles value. The conversion is actually:

.533 microns converted to miles per hour = 3.311908e-10
.674 microns converted to miles per hour = 4.188042e-10

That's quite a significant difference in value.
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 7
Reputation: pyramid is an unknown quantity at this point 
Solved Threads: 0
pyramid pyramid is offline Offline
Newbie Poster

Re: calculate car speed (mph) using speed of light

 
0
  #4
Oct 23rd, 2007
Thanks you guys.
I finally got my codes to work, and have submitted my lab.

You are correct, including the exponent in the miles value made a SIGNIFICANT difference.


Thanks again.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC