subject

Program 2: In the earlier team project, your team put together a program that interpolated between two position values based on the time values when each positon was observed. This was a one dimensional (10) interpolation, since you were interpolating only a single value, the distance on the track. You are now going to extend that program to one that will linearly interpolate between two points in 3D.
Let's say we are tracking the change of a particle's position with time. So, at time t1 position is (x1, y1, z1) and at time t2 position is (x2, y2, 22). The question is what is the position (x, y, z) at some time to between t1 and t2?
Refer again to the Linear Interpolation material associated with Lab Assignment2. That material describes the development of equation representing linear interpolation of a dependent variable y versus an independent variable x. For the current problem, what varies linearly with what? What are the dependent variable(s)? What are the independent variable(s)?
Let's assume that each of the position variables (x, y, z) varies linearly with time (t). Therefore, time (t) is the independent variable in each case. This means we can perform linear interpolation three separate times to get what we need. This can be done in three steps: 1) linearly interpolate between (t1, x1) and (t2, x2) for to with XO as the result; 2) repeat for (t1, y1) and (t2, y2) for to with yo as the result; 3) repeat for (t1, z1) and (t2, z2) for to with z0 as the result. The result will be (x, y, z0) associated with time to.
Write a program that will take two observed 3D positions at two points in time, and then will calculate the 3D position at a third point in time. Let's consider only times between the two observed times. You should output the x, y, and z values for that position on separate lines. Begin by identifying the variables you will use, the names for those variables, and the computations that should occur for those variables. Then, write a program that will output the 3D position of the interpolated point on 3 separate lines.
For this initial program, you can use the following data values:
• At time 13, observed position was (1,3,7) meters
• At time 84, observed position was (23, -5, 10) meters
• You want to find the position at time 50 seconds
As for Program 1 above, please document your code using comments and print data labels and units to the screen to identify your output. Sample output:
time of interest = 50 seconds
x0 = 12.464788732394366 m
y0 = -1.169014084507042 m
z0 = 8.56338028169014 m

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 07:50, OnlyaBurden
In this lab, you complete a prewritten c++ program for a carpenter who creates personalized house signs. the program is supposed to compute the price of any sign a customer orders, based on the following facts: the charge for all signs is a minimum of $35.00. the first five letters or numbers are included in the minimum charge; there is a $4 charge for each additional character. if the sign is made of oak, add $20.00. no charge is added for pine. black or white characters are included in the minimum charge; there is an additional $15 charge for gold-leaf lettering. instructions ensure the file named housesign. cppis open in the code editor. you need to declare variables for the following, and initialize them where specified: a variable for the cost of the sign initialized to 0.00 (charge). a variable for the number of characters initialized to 8 (numchars). a variable for the color of the characters initialized to "gold" (color). a variable for the wood type initialized to "oak" (woodtype). write the rest of the program using assignment statements and ifstatements as appropriate. the output statements are written for you. execute the program by clicking the run button. your output should be: the charge for this sign is $82. this is the code, // housesign. cpp - this program calculates prices for custom made signs. #include #include using namespace std; int main() { // this is the work done in the housekeeping() function // declare and initialize variables here // charge for this sign // color of characters in sign // number of characters in sign // type of wood // this is the work done in the detailloop() function // write assignment and if statements here // this is the work done in the endofjob() function // output charge for this sign cout < < "the charge for this sign is $" < < charge < < endl; return(0); }
Answers: 1
image
Computers and Technology, 24.06.2019 02:00, ishmael9332
How are we able to create photographs differently than 100 years ago? explain your answer in relation to your photograph you selected.
Answers: 1
image
Computers and Technology, 24.06.2019 21:30, zlyzoh
Write an algorithm to check if a number is even or odd and show with flow chart step by step
Answers: 2
image
Computers and Technology, 25.06.2019 05:10, ethanmel21
Assume that two parallel arrays have been declared and initialized: healthoption an array of type char that contains letter codes for different healthcare options and annual cost an array of type int. the i-th element of annual cost indicates the annual cost of the i-th element of healthoption. in addition, there is an char variable, best2.write the code necessary to assign to best2 the health option with the lower annual cost, considering only the first two healthcare options. thus, if the values of healthoption are 'b', 'q', 'w', 'z' and the values of annualcost are 8430, 9400, 7050, 6400 your code would assign 'b' to best2 because 8430 is less than 9400 and is associated with 'b' in the parallel array. (we ignore 'w' and 'z' because we are considering only the first two options.)
Answers: 1
You know the right answer?
Program 2: In the earlier team project, your team put together a program that interpolated between...

Questions in other subjects:

Konu
Mathematics, 02.08.2019 21:50
Konu
Mathematics, 02.08.2019 21:50