a program named Lab2b_Act2a.py 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, use the following data values:●At time 12 seconds, observed position was (2, 3, 7) meters●At time 85 seconds, observed position was (25, -5, 11) meters●You want to find the position at time 45 seconds. Now, copy Lab2b_Act2a.py from above into a new program named Lab2b_Act2b.py. Modify your program in the following ways:i.When printing the posi

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 19PE
icon
Related questions
Question

Write a program named Lab2b_Act2a.py 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, use the following data values:●At time 12 seconds, observed position was (2, 3, 7) meters●At time 85 seconds, observed position was (25, -5, 11) meters●You want to find the position at time 45 seconds.

Now, copy Lab2b_Act2a.py from above into a new program named Lab2b_Act2b.py. Modify your program in the following ways:i.When printing the position, follow the output by a line of dashes (“-------------------”).ii.Instead of just computing the interpolation at one point and printing the result, you will now compute it at 5 points. Copy the portion of the code (copy and paste the code) that is needed to recompute interpolation 5 times. You should now interpolate at times in increments of 1 second, starting at time 45 seconds (i.e. at times 45, 46, 47, 48, 49), printing the result each time. The line of dashes will separate each computation. (Note: later we will see how we can do this more efficiently, without copying-and-pasting code, but for now, copy-and-paste your code.)

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning