给定一个圆,该圆具有和弦,并且在圆心上的夹角为弦。此处的任务是找到圆周上给定弦所对向的角度的量度。
例子:
输入: = 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