![]() |
VOOZH | about |
A circular sector or circle sector is the portion of a disk enclosed by two radii and an arc, where the smaller area is known as the minor sector and the larger being the major sector. Let's look at this figure and try to figure out the sector:
In this figure the green shaded part is a sector, "r" is the Radius and "theta" is the angle as shown. Here, we can say that the shaded portion is the minor sector and the other portion is the major sector. "L" is the Arc of the Sector. For more, visit Sector.
Now let's see the formula using which the sector of a circle can be calculated.
The area of the sector is similar to the calculation of the area of the circle, just multiply the area of the circle with the angle of the sector.
Examples:
Input: radius = 9 angle = 60 Explanation: Sector = ( pi * 9*9 ) * ( 60 / 360 ) Output: 42.42857142857142 Input: radius = 20 angle = 145 Explanation: Sector = ( pi * 20*20 ) * ( 145 / 360 ) Output: 506.3492063492063
Output:
42.42857142857142
Time complexity: O(1)
Auxiliary Space: O(1)
Reference: Wikipedia (Circular Sector)