📜  圆形扇区的面积

📅  最后修改于: 2021-10-23 08:38:59             🧑  作者: Mango

圆形扇区或圆形扇区是由两个半径和一个弧包围的磁盘部分,其中较小的区域称为次扇区,较大的区域称为主扇区。让我们看一下这个数字并尝试找出该部门:

来源:维基百科(https://goo.gl/mWijn2)

在这个图中,绿色阴影部分是一个扇区,“r”是半径,“theta”是如图所示的角度。在这里,我们可以说阴影部分是次要部门,另一部分是主要部门。 “L”是扇区的弧。有关更多信息,请访问部门。
现在让我们看看可以使用哪个公式来计算圆的扇区。

扇形面积与圆面积的计算类似,只是圆的面积乘以扇形的角度即可。
例子:

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

C++
// C++ program to find Area of a Sector
#include 
using namespace std;
 
void SectorArea(double radius,double angle)
{
    if(angle >= 360)
        cout<<"Angle not possible";
     
    // Calculating area of the sector
    else
    {
        double sector = ((22 * radius * radius) / 7)
                       * (angle / 360);
        cout<


Java
// Java program to find Area of a Sector
 
class GFG
{
    static void SectorArea(double radius,double angle)
    {
        if(angle >= 360)
            System.out.println("Angle not possible");
         
        // Calculating area of the sector
        else
        {
            double sector =((22 * radius * radius) / 7)
                           * (angle / 360);
            System.out.println(sector);
        }
    }
     
    // Driver code
    public static void main (String[] args)
    {
        double radius = 9;
        double angle = 60;
        SectorArea(radius, angle);
    }
}
// This code is contributed by Anant Agarwal.


Python3
# Python program to find Area of a Sector
 
def SectorArea(radius, angle):
    pi = 22 / 7
     
    # Constraint or Limit
    if angle >= 360:
        print("Angle not possible")
        return
     
    # Calculating area of the sector
    else:
        sector = (pi * radius ** 2) * (angle / 360)
        print(sector)
        return
 
# Driver code
radius = 9
angle = 60
SectorArea(radius, angle)


C#
// C# program to find Area of a Sector
using System;
 
class GFG {
     
    static void SectorArea(double radius, double angle)
    {
         
        if (angle >= 360)
            Console.WriteLine("Angle not possible");
 
        // Calculating area of the sector
        else {
            double sector = ((22 * radius * radius) / 7)
                            * (angle / 360);
                             
            Console.WriteLine(sector);
        }
    }
 
    // Driver code
    public static void Main()
    {
        double radius = 9;
        double angle = 60;
         
        SectorArea(radius, angle);
    }
}
 
// This code is contributed by vt_m.


PHP
= 360)
        echo("Angle not possible");
     
    // Calculating area of the sector
    else
    {
        $sector = ((22 * $radius * $radius)
                     / 7) * ($angle / 360);
        echo($sector);
    }
}
 
// Driver code
 
    $radius = 9;
    $angle = 60;
    SectorArea($radius, $angle);
     
// This code is contributed by vt_m.
?>


Javascript


输出:

42.42857142857142