给定一个具有两条等长弦的圆。给出了其中一根弦对中心的对角。这里的任务是找到另一个和弦在中心所对的角度的度量。
例子:
Input: 48
Output: 48 degrees
Input: 82
Output: 82 degrees
方法:
令AC和BD是圆心在O的两个相等的弦。令弦AC所对的角度为x度。
现在,
在三角形AOC和BOD 中,
AO = OB (同圆的半径)
AB = CD (等弦)
OC = OD (同圆的半径)
所以,三角形AOC和BOD彼此全等
所以,角AOC = 角BOD
Equal chords of a circle subtend equal angles at the centre.
下面是上述方法的实现:
C++
// C++ program to find the angle
// subtended at the center by the chord
// when the angle subtended at center
// by another chord of equal length is given
#include
using namespace std;
void angleequichord(int z)
{
cout << "The angle subtended at the center is "
<< z << " degrees" << endl;
}
// Driver code
int main()
{
int z = 48;
angleequichord(z);
return 0;
}
Java
// Java program to find the angle
// subtended at the center by the chord
// when the angle subtended at center
// by another chord of equal length is given
import java.io.*;
class GFG
{
static void angleequichord(int z)
{
System.out.println ( "The angle subtended at the center is "+
z + " degrees");
}
// Driver code
public static void main (String[] args)
{
int z = 48;
angleequichord(z);
}
}
// This code is contributed by ajit.
Python3
# Python3 program to find the angle
# subtended at the center by the chord
# when the angle subtended at center
# by another chord of equal length is given
def angleequichord(z) :
print("The angle subtended at",
"the center is", z ,"degrees" );
# Driver code
if __name__ == "__main__" :
z = 48;
angleequichord(z);
# This code is contributed by AnkitRai01
C#
// C# program to find the angle
// subtended at the center by the chord
// when the angle subtended at center
// by another chord of equal length is given
using System;
class GFG
{
static void angleequichord(int z)
{
Console.WriteLine( "The angle subtended at the center is "+
z + " degrees");
}
// Driver code
public static void Main (String[] args)
{
int z = 48;
angleequichord(z);
}
}
/* This code contributed by PrinciRaj1992 */
Javascript
输出:
The angle subtended at the center is 48 degrees
如果您希望与专家一起参加现场课程,请参阅DSA 现场工作专业课程和学生竞争性编程现场课程。