Program to find area of a Circular Segment | Python3 Program to find area of segment of a circle ; Function to find area of segment ; Calculating area of sector ; Calculating area of triangle ; Driver Code
import math NEW_LINE pi = 3.14159 NEW_LINE def area_of_segment ( radius , angle ) : NEW_LINE INDENT area_of_sector = pi * NEW_LINE INDENT ( radius * radius ) NEW_LINE * ( angle / 360 ) NEW_LINE DEDENT area_of_triangle = 1 / 2 * NEW_LINE INDENT ( radius * radius ) * NEW_LINE math . sin ( ( angle * pi ) / 180 ) NEW_LINE DEDENT return area_of_sector - area_of_triangle ; NEW_LINE DEDENT radius = 10.0 NEW_LINE angle = 90.0 NEW_LINE print ( " Area ▁ of ▁ minor ▁ segment ▁ = " , area_of_segment ( radius , angle ) ) NEW_LINE print ( " Area ▁ of ▁ major ▁ segment ▁ = " , area_of_segment ( radius , ( 360 - angle ) ) ) NEW_LINE