Suppose there are 4 cars A, B, C, and D. D is chased by C, C...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Suppose there are 4 cars A, B, C, and D. D is chased by C, C is chased by B, B is chased by A. D is moving independently parallel to y-axis. Initial positions of A, B, C, and D are (10,0), (0,10), (10,10) and (0,0). Velocities of A, B, C and D are 3, 5, 7 and 2 ms¹¹. Now simulate this chase problem for t=20 unit time. Print the x and y coordinate value of each vehicle at every time step. If The distance between any 2 vehicles is less than 5 m then a car will shoot its target [not destroy]. Print all the shootings and finally print the number of times each car got shot during the simulation. Also draw the graph showing the path of each car. Use plt.plot() function to do this. Suppose there are 4 cars A, B, C, and D. D is chased by C, C is chased by B, B is chased by A. D is moving independently parallel to y-axis. Initial positions of A, B, C, and D are (10,0), (0,10), (10,10) and (0,0). Velocities of A, B, C and D are 3, 5, 7 and 2 ms¹¹. Now simulate this chase problem for t=20 unit time. Print the x and y coordinate value of each vehicle at every time step. If The distance between any 2 vehicles is less than 5 m then a car will shoot its target [not destroy]. Print all the shootings and finally print the number of times each car got shot during the simulation. Also draw the graph showing the path of each car. Use plt.plot() function to do this.
Expert Answer:
Answer rating: 100% (QA)
To simulate this chase problem and calculate the positions shootings and number of times each car go... View the full answer
Related Book For
Computer Networking A Top-Down Approach
ISBN: 978-0136079675
5th edition
Authors: James F. Kurose, Keith W. Ross
Posted Date:
Students also viewed these programming questions
-
Thinking it through Mr.Hulchanski (1) Becky documents"" patient reports he is doing well and will call back if any problems develop."" Is this the correct note to make in the chart? Why or why not?...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
At December 31, 2020, the following information was available for Tai Lin Goods: ending inventory HK$400,000, beginning inventory HK$580,000, cost of goods sold HK$2,842,000, and sales revenue...
-
A 20-ft3 tank contains ammonia at 20 lbf/in 2, 80 F. The tank is attached to a line flowing ammonia at 180 lbf/in 2, 140 F. The valve is opened, and mass flows in until the tank is half full of...
-
Mass air flow (MAF) sensors are designed to work with other temperature and pressure sensors in the intake circuit. This allows the PCM to compensate for four [4] changing conditions such as?
-
Why is the executive summary an important part of the report?
-
Just before Walker Laboratories opened for business, James Walker, the owner, had the following assets and liabilities. Determine the totals that would appear in the firms fundamental accounting...
-
During August, the following transactions occurred:\ Aug 1 Paid August rental cost for aircraft, dockage, and dockside office, $6,800 .\ 2 Paid the insurance premium for August, $3,600 .\ Paid for...
-
Margie Company needs your help to record and summarize its accounting transactions for 2021 and to prepare its financial statements for that year. Margie Company provided you with the following...
-
You notice that Dell Computers has a stock price of $27.85 and EPS of $1.26. Its competitor Hewlett-Packard has EPS of $2.47. What is one estimate of the value of a share of Hewlett-Packard stock?...
-
How is book value per share calculated? Explain how inflation and R&D programs might cause book values to deviate from market values.
-
What are the benefits of installment reporting?
-
What does the price/earnings (P/E) ratio show? If one firms P/E ratio is lower than that of another firm, what factors might explain the difference?
-
Rhia Co. began operations in 2018. Are there restrictions on the tax year it may use?
-
MPI Incorporated has $6 billion in assets, and its tax rate is 25%. Its basic earning power (BEP) ratio is 11%, and its return on assets (ROA) is 6%. What is MPIs times interest-earned (TIE) ratio?
-
Solve the following problems. Write your complete solutions on a separate sheet of paper 1. A man repays a loan of 65,000 by paying 400 in the first month and then increasing the payment by 300 every...
-
(a) Given a mean free path = 0.4 nm and a mean speed vav = 1.17 105 m/s for the current flow in copper at a temperature of 300 K, calculate the classical value for the resistivity of copper. (b)...
-
Describe how the RTS threshold works.
-
Repeat P23 but assume that r =2. Assume again that the bucket is initially full.
-
Suppose you are interested in detecting the number of hosts behind a NAT. You observe that the IP layer stamps an identification number sequentially on each IP packet. The identification number of...
-
If you know the electric field \(\vec{E}\) at some location, how can you determine the magnitude and direction of the electric force exerted by that field on an object carrying a charge \(q\) and...
-
(a) If the particle in Figure 23.6 carries a negative charge \(q (b) Does the electric field created by the particle point toward or away from the particle? (c) If \(q\) and \(q_{2}\) are negative,...
-
(a) If the charge on particle 2 in Exercise 23.1 is doubled so that \(q_{2}=2 q_{1}\), what happens to the direction of the electric field at points \(P_{1}\) through \(P_{4}\) ? (b) If the charge on...
Study smarter with the SolutionInn App