import math
def p(s):print(s)
def o1():
p("=AREA SAS=")
a=float(input("a:"))
b=float(input("b:"))
c=float(input("C:"))
r=c*math.pi/180
ar=0.5*a*b*math.sin(r)
p("A="+str(ar))
def menu():
while True:
p("=TRI AREA=")
p("1:AREA SAS")
p("0:EXIT")
c=input("?>")
if c=="1":o1()
elif c=="0":break
menu()Tier 1 · geometry
Tri Area SAS
Triangle area from two sides and included angle.
Files (1)
How to use it
Triangle area using the SAS formula A = ½·a·b·sin(C), where C is the angle between sides a and b.
Launch TRIAREA from prgm, choose 1:AREA SAS, then:
a:— length of the first side.b:— length of the second side.C:— the angle between them, in degrees (the program converts to radians internally).
Output is A=. Press 0 at the main menu to exit.
Example problem
A triangle has sides 5 and 5 with a 60° angle between them. What's its area?
- Run
TRIAREA, choose1:AREA SAS. a:→ 5,b:→ 5,C:→ 60.- Output:
A=10.825....
Area ≈ 10.83 sq units. Verify: ½ · 5 · 5 · sin(60°) = 12.5 · 0.866 ≈ 10.825. ✓
TI-84 Plus CE — try before committingoff
TI-84 Plus CE
(calculator off) Press ON to start.
Test cases (2)
| ID | Inputs | Expected contains |
|---|---|---|
| eq-5-5-60 | 1, 5, 5, 60, 0 | A=10.8 |
| right-3-4-90 | 1, 3, 4, 90, 0 | A=6 |