フィルターのクリア

Don't understand how they figured out the equations.

2 ビュー (過去 30 日間)
Jessica
Jessica 2014 年 12 月 4 日
コメント済み: Star Strider 2014 年 12 月 4 日
So I have attached the problem that is part of my final review. I have also the code that will give me the answer (shown below). My question is... how did they figure out the equation for "L" and "P"?? I know that it is mostly algebra but still not sure. Any help would be great!
w = 6; %width in meters
A = 80; %area in meters squared
%solve for the length, terms of A, w
L = (A - w^2/4)/w;
%solve for the perimeter
P = 2*L + w + 2*w/sqrt(2);
%display your answers
fprintf('The length is %5.2f\n ', L)
fprintf('The total perimeter is %5.2f\n ', P)
%done

回答 (3 件)

the cyclist
the cyclist 2014 年 12 月 4 日
Here are some facts that may help you make the connection:
The enclosure (area = A) is made up of two parts:
  • A rectangle of area L * W
  • A triangle of area D*D/2
The triangle is a right triangle with side lengths D, D, and W. W is the hypotenuse, so
  • D^2 + D^2 = W^2
Is that enough for you to see how the whole thing works?

Star Strider
Star Strider 2014 年 12 月 4 日
編集済み: Star Strider 2014 年 12 月 4 日
I don’t see ‘P’ anywhere, so I’ll wait for clarification on it.
The rest is relatively straightforward:
First, consider the triangle on the right —
W^2 = 2*D^2
D = W/sqrt(2)
For the area, since it’s a right triangle, D = base = height and the area of it is —
Atri = 0.5 * D^2
The area of the rectangle bounded by L and W is obvious.
So the area of the entire figure is —
Atot = W * L + 0.5 * D^2
I’ll leave you to simplify this expression and do all the coding. (It’s all just secondary-school geometry and algebra.)
  2 件のコメント
the cyclist
the cyclist 2014 年 12 月 4 日
P is the perimeter.
Star Strider
Star Strider 2014 年 12 月 4 日
I assumed that, but since it was over the horizon (not in the Question), I wanted to be sure. I also wanted to be sure it wasn’t ‘D’.

サインインしてコメントする。


Jessica
Jessica 2014 年 12 月 4 日
ok I see. I was confused on why they were dividing by 4 to find "L". Thanks for the help!! :)

カテゴリ

Help Center および File ExchangeComputational Geometry についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by