summaryrefslogtreecommitdiff
path: root/2915/CH2/EX2.15/Ex2_15.sce
blob: cbb54699fa48c4267ede37ef8e70efd7656440f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
//Example 2.15
//To determine area of triangle when 3 sides are given
clc,clear

c=7 //side oposite to vertex C
a=5 //side opposite to vertex A
b=4 //side opposite to vertex B

s= (a+b+c)/2  //semi perimeter
area_K = sqrt(s*(s-a)*(s-b)*(s-c)) //using herons formula
printf('Area of triangle ABC = %.2f square units',area_K)