Dadas dos cuerdas de igual longitud de una circunferencia y Distancia entre el centro y una cuerda. La tarea aquí es encontrar la distancia entre el centro y el otro acorde.
Ejemplos:
Input: 48 Output: 48 Input: 82 Output: 82
A continuación se muestra la implementación del enfoque anterior:
Enfoque :
Sean AB y CD las dos cuerdas iguales del círculo con centro en O. Sea OM la distancia dada de la cuerda AB desde el centro.
ahora en el triangulo AOM y CON ,
OA = OC (radios del mismo circulo)
MA = CN (ya que OM y ON son la perpendicular a la cuerda y la biseca y AM = MB & CN = CD)
angulo AMO = angulo ONC = 90 grados
por lo que los triángulos son congruentes
entonces, OM = ENCENDIDO
Cuerdas iguales de un círculo son equidistantes del centro de un círculo.
A continuación se muestra la implementación del enfoque anterior:
C++
// C++ program to find the distance of chord // from center when distance between center // and another equal length chord is given #include <bits/stdc++.h> using namespace std; void lengequichord(int z) { cout << "The distance between the " << "chord and the center is " << z << endl; } // Driver code int main() { int z = 48; lengequichord(z); return 0; }
Java
// Java program to find the distance of chord // from center when distance between center // and another equal length chord is given/ import java.io.*; class GFG { static void lengequichord(int z) { System.out.println ("The distance between the "+ "chord and the center is "+ z ); } // Driver code public static void main (String[] args) { int z = 48; lengequichord(z); } } // This code is contributed by jit_t.
Python 3
# Python 3 program to find the distance of chord # from center when distance between center # and another equal length chord is given def lengequichord(z): print("The distance between the" , "chord and the center is" , z ) # Driver code if __name__ == "__main__": z = 48 lengequichord(z) # This code is contributed # by ChitraNayal
C#
// C# program to find the distance of chord // from center when distance between center // and another equal length chord is given using System; class GFG { static void lengequichord(int z) { Console.WriteLine("The distance between the "+ "chord and the center is "+ z ); } // Driver code public static void Main () { int z = 48; lengequichord(z); } } // This code is contributed by AnkitRai01
Javascript
<script> // JavaScript program to find the distance of chord // from center when distance between center // and another equal length chord is given function lengequichord(z) { document.write("The distance between the " + "chord and the center is " + z + "<br>"); } // Driver code let z = 48; lengequichord(z); // This code is contributed by Surbhi Tyagi. </script>
The distance between the chord and the center is 48
Complejidad de tiempo: O(1)
Espacio Auxiliar: O(1)
Publicación traducida automáticamente
Artículo escrito por IshwarGupta y traducido por Barcelona Geeks. The original can be accessed here. Licence: CCBY-SA