给定一个圆,它有一个弦和一个由圆心上的弦对的角度。这里的任务是找到圆周上给定弦所对的角度的度量。
例子:
输入: = 90输出: ABC = 45.00 度输入: = 65输出: ABC = 32.50 度
方法:
- 设AC为圆心为O的圆的弦,设C为圆周上任意一点。
- 让,角度AOC (在中心)是给定的
*** QuickLaTeX cannot compile formula: *** Error message: Error: Nothing to show, formula is empty
.
- 所以角度应该在圆周上,
角 ABC = 角 AOC/2
An angle at the circumference of a circle is the half angle at the centre subtended by the same chord.
下面是上述方法的实现:
C++
// C++ Program to calculate angle
// on the circumference subtended
// by the chord when the central angle
// subtended by the chord is given
#include
using namespace std;
float angleOncirCumference(float z)
{
return (z / 2);
}
// Driver code
int main()
{
// Angle on center
float angle = 65;
float z = angleOncirCumference(angle);
cout << "The angle is " << (z) << " degrees";
return 0;
}
// This code is contributed by jit_t
Java
// Java Program to calculate angle on the circumference
// subtended by the chord when the central angle
// subtended by the chord is given
class GFG {
static float angleOncirCumference(float z)
{
return (z / 2);
}
// Driver code
public static void main(String[] args)
{
// Angle on center
float angle = 65;
float z = angleOncirCumference(angle);
System.out.println("The angle is "
+ z + " degrees");
}
}
Python3
# Python3 Program to calculate angle
# on the circumference subtended
# by the chord when the central angle
# subtended by the chord is given
def angleOncirCumference(z):
return (z / 2);
# Driver code
# Angle on center
angle = 65;
z = angleOncirCumference(angle);
print("The angle is", (z), "degrees");
# This code is contributed by Rajput-Ji
C#
// C# Program to calculate angle on the circumference
// subtended by the chord when the central angle
// subtended by the chord is given
using System;
public class GFG
{
static float angleOncirCumference(float z)
{
return (z / 2);
}
// Driver code
public static void Main(String[] args)
{
// Angle on center
float angle = 65;
float z = angleOncirCumference(angle);
Console.WriteLine("The angle is "
+ z + " degrees");
}
}
// This code is contributed by Rajput-Ji
Javascript
输出:
The angle is 32.5 degrees
如果您希望与专家一起参加现场课程,请参阅DSA 现场工作专业课程和学生竞争性编程现场课程。