- #1
CraigDNeo
- 21
- 0
I am working on a little side project in code and I am trying to figure out how to calculate the distance between two moving objects at a give point. If the two objects both started out from rest at the same time, moving in a straight line. Object one moved 330 feet in 4.335 seconds, Object two moved 330 feet in 4.165 seconds. Is there a way calculating an average velocity and/or acceleration to determine how many feet ahead object two is in front ob object one.
I have done the velocity and acceleration calculations, and I am still struggling. For example, I know that Object one has an average velocity of 76.12 feet/second at 330 feet, and object two has an average velocity of 79.23 feet/second. I am not sure how to get the acceleration of the two objects. I do have a reference point, object one hit 60 feet 1.562 seconds and object two hit 60 feet in 1.450 seconds.
So what I did was subtract the difference in velocity for object one to get acceleration. Object one went from 60 feet to 330 feet in (4.335s - 1.562s) which is 270 feet / 2.773s which gives me an average velocity of 97.36 feet/s. Object two went from 60 feet to 330 feet in (4.165 - 1.450) which is 270 feet / 2.715s, which gives me an average velocity of 99.44 feet/s.
From those values I calculated acceleration, object one moved that 270 feet at a rate of (97.36f/s - (60f/1.562))/2.773 is 21.25 ft/s/s, and object two moved that 270 feet at a rate of (99.44 f/s - (60f/1.450))/2.715s is 21.38 ft/s/s.
Now, I think I got the velocity and acceleration calcs correct, but I am not sure how to get distance, and when I plug in the numbers in a distance formula, they just don't seem right.
Can someone help me out, or please guide me in the right direction on what I am doing wrong.
Thanks in advance for your time and response.
I have done the velocity and acceleration calculations, and I am still struggling. For example, I know that Object one has an average velocity of 76.12 feet/second at 330 feet, and object two has an average velocity of 79.23 feet/second. I am not sure how to get the acceleration of the two objects. I do have a reference point, object one hit 60 feet 1.562 seconds and object two hit 60 feet in 1.450 seconds.
So what I did was subtract the difference in velocity for object one to get acceleration. Object one went from 60 feet to 330 feet in (4.335s - 1.562s) which is 270 feet / 2.773s which gives me an average velocity of 97.36 feet/s. Object two went from 60 feet to 330 feet in (4.165 - 1.450) which is 270 feet / 2.715s, which gives me an average velocity of 99.44 feet/s.
From those values I calculated acceleration, object one moved that 270 feet at a rate of (97.36f/s - (60f/1.562))/2.773 is 21.25 ft/s/s, and object two moved that 270 feet at a rate of (99.44 f/s - (60f/1.450))/2.715s is 21.38 ft/s/s.
Now, I think I got the velocity and acceleration calcs correct, but I am not sure how to get distance, and when I plug in the numbers in a distance formula, they just don't seem right.
Can someone help me out, or please guide me in the right direction on what I am doing wrong.
Thanks in advance for your time and response.