给定两个和弦,它们在圆的直径上相等地倾斜。给出一个和弦的长度。任务是找到另一个和弦的长度。
例子:
Input: z = 48
Output: 48 degrees
Input: z = 93
Output: 93 degrees
方法:
- 令AB和AC为以O为中心的圆的两个和弦。
- 现在,在图中我们看到,
OL垂直于AB , OM垂直于AC - 在三角形OLA和三角形OMA中,
角度OLA =角度OMA = 90度
角度OAL =角度OAM (因为弦在直径上相等地倾斜)
OA = OA (公共端) - 因此三角形OLA和三角形OMA是完全相同的。
- 因此, OL = OM
- 并且我们知道,相等的和弦与中心等距,因此AB和AC的长度相同。
If two chords are equally inclined through the diameter of the same circle, then they are of equal length.
下面是上述方法的实现:
C++
// C++ program to find
// the length of the chord the circle
// if length of the another chord
// which is equally inclined
// through the diameter is given
#include
using namespace std;
void lengchord(int z)
{
cout << "The length is "
<< z << endl;
}
// Driver code
int main()
{
int z = 48;
lengchord(z);
return 0;
}
Java
// Java program to find
// the length of the chord the circle
// if length of the another chord
// which is equally inclined
// through the diameter is given
import java.io.*;
class GFG
{
static void lengchord(int z)
{
System.out.println ("The length is "+ z );
}
// Driver code
public static void main (String[] args)
{
int z = 48;
lengchord(z);
}
}
// The code has been contributed by ajit.
Python3
# Python3 program to find
# the length of the chord of the circle
# if length of the other chord
# which is equally inclined
# through the diameter is given
def lengchord(z):
print("The length is ", end = "");
print(z);
# Driver code
z = 48;
lengchord(z);
# This code is contributed
# by Princi Singh
C#
// C# program to find
// the length of the chord the circle
// if length of the another chord
// which is equally inclined
// through the diameter is given
using System;
class GFG
{
static void lengchord(int z)
{
Console.WriteLine("The length is "+ z );
}
// Driver code
static public void Main ()
{
int z = 48;
lengchord(z);
}
}
// The code has been contributed by Tushil
Javascript
输出:
The length is 48