How can I solve this problem?
Informazioni
Questa domanda è chiusa. Riaprila per modificarla o per rispondere.
Mostra commenti meno recenti
Create a function (x,y,r) = InsideCircle (P1,P2), where P1 = (x1,y1) and P2 = (x2,y2) are the upper left and lower right corners of a rectangle. The output contains the 'x' and 'y' coordinates of the center of a circle with radius 'r' which is centered inside the input rectangle defined by (p1,p2) and touches only two sides. What is the value of 'x' , 'y' , 'r' if P1=(30,20) and P2=(10,10). Is the function header in correct format?
Risposte (1)
Andrei Bobrov
il 23 Set 2016
Modificato: Andrei Bobrov
il 23 Set 2016
function [x,y,r] = InsideCircle (P1,P2)
d = (P1-P2)/2;
r = min(abs(d));
x = P2(1)+d(1);
y = P2(2)+d(2);
end
Questa domanda è chiusa.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!