Hint: For the SSS case, you are given the 3 sides a, b, and c, and need to find the corresponding angles α, β, and γ. To find α, for example, you solve the equation a^2==b^2+c^2-2b c Cos[α]
for the variable α
. There will be 2 outputs, and the positive output will be your solution.
Now use that solution to create the function α[a_,b_c,_]:= (the output you obtained)*180/π//N (multiplying by 180/\[DoubledPi]
will convert the angle from radians to degrees and postfixing //N will give an approximation to the angle). Do the same for β and γ. (For β you will solve the equation b^2==a^2+c^2-2a c Cos[β]
for β, and use a similar equation to solve for γ).
You can then create the function sss[a_,b_,c_]:={α[a,b,c], β[a,b,c], γ[a,b,c], a, b, c}]
which has input the 3 sides and as output the 3 angles and the 3 sides. Check your work by doing Example 2.
this is the given hint my professor provided.
Reduce[a^2 == b^2 + c^2 - 2 b c Cos[α]]
a == -Sqrt[b^2 + c^2 - 2 b c Cos[α]] ||
a == Sqrt[b^2 + c^2 - 2 b c Cos[α]]
f[α[a_, b_, c_] :=
Sqrt[b^2 + c^2 - 2 b c Cos[α]]*180/π // N]
f[Null]
This is as far as I've got. I don't think I'm using the proper code.
SSSTriangle
which work with symbolic inputs:$Assumptions = Thread[{a, b, c} > 0]; t = SSSTriangle[a, b, c]; Simplify[PolygonAngle[t] /. {Conjugate -> Identity, Abs -> Identity}]
$\endgroup$ – flinty Dec 6 '20 at 14:48