Program to find area of a Circular Segment | javascript program to find area of segment of a circle ; Function to find area of segment ; Calculating area of sector ; Calculating area of triangle ; Driver Function
let pi = 3.14159 ; function area_of_segment ( radius , angle ) { let area_of_sector = pi * ( radius * radius ) * ( angle / 360 ) ; let area_of_triangle = 1 / 2 * ( radius * radius ) * Math . sin ( ( angle * pi ) / 180 ) ; return area_of_sector - area_of_triangle ; } let radius = 10.0 , angle = 90.0 ; document . write ( " " + area_of_segment ( radius , angle ) + " " ) ; document . write ( " " + area_of_segment ( radius , ( 360 - angle ) ) ) ;