← Library
Tier 1 · geometry

Tri Area SAS

Triangle area from two sides and included angle.

Files (1)
TRIAREA.py315 bytes
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()
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:

  1. a: — length of the first side.
  2. b: — length of the second side.
  3. 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?

  1. Run TRIAREA, choose 1:AREA SAS.
  2. a:5, b:5, C:60.
  3. 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)
IDInputsExpected contains
eq-5-5-601, 5, 5, 60, 0A=10.8
right-3-4-901, 3, 4, 90, 0A=6