how would you work out speed between two sensors which is 500m apart. using speed=distance/time. when the car enters the first sensor say the time was 3:00 58 seconds. and the second sensor is 3:01 26 seconds. then the difference between the times ill be used in the formula, so speed=100/0.28. and if the car is over the sped limit the number plate will be recorded.
Paven123 0 Newbie Poster
Recommended Answers
Jump to PostMaybe of some help ...
import datetime as dt # the two measured times in format hh:mm:ss tm1 = "3:00:58" tm2 = "3:01:26" h1, m1, s1 = tm1.split(':') h2, m2, s2 = tm2.split(':') d1 = dt.timedelta(hours=int(h1), minutes=int(m1), seconds=int(s1)) d2 = dt.timedelta(hours=int(h2), minutes=int(m2), seconds=int(s2)) # time difference delta …
All 4 Replies
Gribouillis 1,391 Programming Explorer Team Colleague
Paven123 0 Newbie Poster
Gribouillis 1,391 Programming Explorer Team Colleague
vegaseat 1,735 DaniWeb's Hypocrite Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.