Don't understand how they figured out the equations.
Afficher commentaires plus anciens
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
Réponses (3)
the cyclist
le 4 Déc 2014
0 votes
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
le 4 Déc 2014
Modifié(e) : Star Strider
le 4 Déc 2014
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 commentaires
the cyclist
le 4 Déc 2014
P is the perimeter.
Star Strider
le 4 Déc 2014
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
le 4 Déc 2014
0 votes
Catégories
En savoir plus sur Mathematics dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!