How can I solve this problem?
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
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?
0 件のコメント
回答 (1 件)
Andrei Bobrov
2016 年 9 月 23 日
編集済み: Andrei Bobrov
2016 年 9 月 23 日
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
0 件のコメント
この質問は閉じられています。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!