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, 22.06.2019 22:30
Write a full class definition for a class named player , and containing the following members: a data member name of type string .a data member score of type int .a member function called setname that accepts a parameter and assigns it to name . the function returns no value.a member function called setscore that accepts a parameter and assigns it to score . the function returns no value.a member function called getname that accepts no parameters and returns the value of name .a member function called getscore that accepts no parameters and returns the value of score .this is what i have, aparently this is wrong: class player{private: string name; int score; public: void player: : setname (string n){name =n; }void player: : setscore (int s){score = s; }string player: : getname (){return name; }int player: : getscore (){return score; }};
Answers: 2
question
Computers and Technology, 22.06.2019 22:40
When you type the pwd command, you notice that your current location on the linux filesystem is the /usr/local directory. answer the following questions, assuming that your current directory is /usr/local for each question. a. which command could you use to change to the /usr directory using an absolute pathname? b. which command could you use to change to the /usr directory using a relative pathname? c. which command could you use to change to the /usr/local/share/info directory using an absolute pathname? d. which command could you use to change to the /usr/local/share/info directory using a relative pathname? e. which command could you use to change to the /etc directory using an absolute pathname? f. which command could you use to change to the /etc directory using a relative pathname?
Answers: 3
question
Computers and Technology, 23.06.2019 09:30
Given a link with a maximum transmission rate of 32.8 mbps. only two computers, x and y, wish to transmit starting at time t = 0 seconds. computer x sends filex (4 mib) and computer y sends filey (244 kib), both starting at time t = 0. statistical multiplexing is used, with details as follows packet payload size = 1000 bytes packet header size = 24 bytes (overhead) ignore processing and queueing delays assume partial packets (packets consisting of less than 1000 bytes of data) are padded so that they are the same size as full packets. assume continuous alternating-packet transmission. computer x gets the transmission medium first. at what time (t = ? ) would filey finish transmitting? give answer in milliseconds, without units, and round to one decimal places (e.g. for an answer of 0.013777 seconds you would enter "13.8" without the quotes)
Answers: 3
question
Computers and Technology, 24.06.2019 05:30
Cómo pongo un tomo de llamada sin pagar?
Answers: 1
You know the right answer?
The purpose of this activity is to practice writing simple programs that require multiple variables,...
Questions
question
Mathematics, 15.07.2020 14:01
question
Mathematics, 15.07.2020 14:01
question
English, 15.07.2020 14:01
Questions on the website: 13722367