An object leaves point P 1 with coordinates (−1,0) and travels with velocity v 1=1 in a straight line to point P 2 with coordinates (0, h ) . It then travels with velocity v 2=2 in a straight line...


An object leaves pointP1 with coordinates (−1,0) and travels with velocityv1=1 in a straight line to pointP2 with coordinates (0,h) . It then travels with velocityv2=2 in a straight line fromP2 to pointP3 with coordinates (x , y ).


Givenx andy values there will be some optimalh value that minimizes the total travel time. Write a program in Scilab containing a function in the form


function u = h(x,y)


[your code goes here]


endfunction


u = h(1,2);


disp(u);


that calculates this optimalh value (to an accuracy of about 10^−6 ) givenx andy values as arguments. Your function must work for any positive values ofx andy.



Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here