subject

The purpose of this activity is to practice writing simple programs that require multiple variables, and to ensure you understand the idea of interpolation. the individual assignment will build on this program.

write a short program in python that performs linear interpolation. here is the scenario:

you arrive at a racetrack and observe a car moving around a track at what appears to be a constant speed. you would like to be able to predict where the car is at any point in time. to do this, you take a measurement of how far around the track the vehicle has traveled at two points in time. assume that the track is marked so that you can determine position very precisely. you note the time of this first position measurement. a short while later (before the vehicle has passed the "starting" point on the track), you take a second measurement for how far around the track the vehicle has traveled, again noting the time.

now, assume that you’d like to reconstruct the position of the vehicle at any time between the first measurement and the second. since you assume the vehicle is moving at constant speed, this calculation can be found precisely by linear interpolation.

as a team, determine what variables you will need to use, and what formula(s) you will need to use to perform this calculation. you should use variables for all of the values that could change.

now, assume that for your observation, the first measurement was taken 30 seconds after you arrived, and the second was taken 45 seconds after you arrived. at the first measurement, the car was 50 meters past the starting line of the track. at the second measurement, the car was 615 meters past the starting line of the track.

write a program that determines, for any time between 30 and 45 seconds, where the car will be on the track (in terms of meters past the starting line). the time to evaluate at should be a variable in your program. the program should print both the time and the position at that time to the screen, with a line describing what is being output. you should test your program at various times and make sure the results seem reasonable.

for your final program that you turn in, you can assume that you want to know the position at a time 37 seconds after you first arrived. (next week, we will see how you can read in numbers from a user, but for now, just assume it is a fixed number of seconds.)

assume the racetrack is circular with radius 0.5 kilometers. notice that every time the car passes the starting point of the track, its "distance" from the starting point gets reset to 0. so, if you go far into the future, say at a point 20 minutes after your arrival time, simple linear interpolation will not work. see if you can modify your code to report distances correctly regardless of the time.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 04:00
Another name for addicting games.com
Answers: 1
question
Computers and Technology, 23.06.2019 04:00
In a word processing program, such as microsoft word, which feature to you choose the desired picture enhancement?
Answers: 2
question
Computers and Technology, 23.06.2019 12:00
What type of slide show is a dynamic and eye-catching way to familiarize potential customers with what your company has to offer? a. ole b. photo album c. brochure d. office clipboard
Answers: 2
question
Computers and Technology, 23.06.2019 20:40
On nba 2k 19, every time i try to join a my park game, it leads ro a website telling my dad that he needs ps plus. i already have ps plus though. how do i fix this?
Answers: 2
You know the right answer?
The purpose of this activity is to practice writing simple programs that require multiple variables,...
Questions
question
Mathematics, 24.06.2020 21:01
question
Mathematics, 24.06.2020 21:01
question
History, 24.06.2020 21:01
Questions on the website: 13722363