summaryrefslogtreecommitdiff
path: root/2915/CH4/EX4.12/Ex4_12.sce
blob: dd879f272bce88d789925f31eabee75b61a93f9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
clc,clear
//Example 4.12
//To determine area of segment formed by a chord in circle

radius = 2
chord = 3
//Use law of cosines
cos_theta = (radius^2+radius^2-chord^2)/(2*radius*radius)
theta=acos(cos_theta) //subtended central angle in radians

area_K=radius^2* (theta-sin(theta))/2
printf('Required area of segment = %.3f square units',area_K)