Given a circle whose radius and the angle subtended at the centre by its chord is given. The task is to find the length of the chord.

**Examples:**

Input:r = 4, x = 63Output:4.17809Input::r = 9, x = 71Output::10.448

**Approach**:

- Let the circle has center at
**O**and has radius**r**, and it’s chord be**AB**. - length of the chord be
**2d**, and the angle subtended by it on the center be**2x**degrees. - As the perpendicular dropped at the chord bisects the chord so, the perpendicular also equally divides the subtended angle
**2x**in**x**degrees. - So, from the diagram,

**d/r = sin(x*π/180)**(here x deg is converted in radians) - So,
**d = rsin(x*π/180)**

therefore,**2d = 2rsin(x*π/180)**

- So,

Below is the implementation of the above approach:

## C++

`// C++ program to find the length chord ` `// of the circle whose radius ` `// and the angle subtended at the centre ` `// is also given ` ` ` `#include <bits/stdc++.h> ` `using` `namespace` `std; ` ` ` `// Function to find the length of the chord ` `void` `length_of_chord(` `double` `r, ` `double` `x) ` `{ ` ` ` `cout << ` `"The length of the chord"` ` ` `<< ` `" of the circle is "` ` ` `<< 2 * r * ` `sin` `(x * (3.14 / 180)) ` ` ` `<< endl; ` `} ` ` ` `// Driver code ` `int` `main() ` `{ ` ` ` `double` `r = 4, x = 63; ` ` ` `length_of_chord(r, x); ` ` ` `return` `0; ` `} ` |

*chevron_right*

*filter_none*

## Java

`// Java program to find the length chord ` `// of the circle whose radius ` `// and the angle subtended at the centre ` `// is also given ` ` ` `class` `GFG ` `{ ` ` ` `// Function to find the length of the chord ` `static` `void` `length_of_chord(` `double` `r, ` `double` `x) ` `{ ` ` ` `System.out.println(` `"The length of the chord"` ` ` `+ ` `" of the circle is "` ` ` `+ ` `2` `* r * Math.sin(x * (` `3.14` `/ ` `180` `))); ` `} ` ` ` `// Driver code ` `public` `static` `void` `main(String[] args) ` `{ ` ` ` `double` `r = ` `4` `, x = ` `63` `; ` ` ` `length_of_chord(r, x); ` `} ` `} ` ` ` `// This code contributed by Rajput-Ji ` |

*chevron_right*

*filter_none*

## Python3

`# Python3 program to find the length chord ` `# of the circle whose radius ` `# and the angle subtended at the centre ` `# is also given ` ` ` `import` `math as mt ` ` ` `# Function to find the length of the chord ` `def` `length_of_chord(r, x): ` ` ` ` ` `print` `(` `"The length of the chord"` ` ` `,` `" of the circle is "` ` ` `,` `2` `*` `r ` `*` `mt.sin(x ` `*` `(` `3.14` `/` `180` `))) ` ` ` ` ` `# Driver code ` `r ` `=` `4` `x ` `=` `63` `; ` `length_of_chord(r, x) ` ` ` `# This code is contributed by mohit kumar ` |

*chevron_right*

*filter_none*

## C#

`// C# program to find the length chord ` `// of the circle whose radius ` `// and the angle subtended at the centre ` `// is also given ` `using` `System; ` ` ` `class` `GFG ` `{ ` ` ` ` ` `// Function to find the length of the chord ` ` ` `static` `void` `length_of_chord(` `double` `r, ` `double` `x) ` ` ` `{ ` ` ` `Console.WriteLine(` `"The length of the chord"` `+ ` ` ` `" of the circle is "` `+ ` ` ` `2 * r * Math.Sin(x * (3.14 / 180))); ` ` ` ` ` `} ` ` ` ` ` `// Driver code ` ` ` `public` `static` `void` `Main(String[] args) ` ` ` `{ ` ` ` `double` `r = 4, x = 63; ` ` ` `length_of_chord(r, x); ` ` ` `} ` `} ` ` ` `// This code is Contributed by Naman_Garg ` |

*chevron_right*

*filter_none*

## PHP

`<?php ` `// PHP program to find the length chord ` `// of the circle whose radius and the ` `// angle subtended at the centre ` `// is also given ` ` ` `// Function to find the length of the chord ` `function` `length_of_chord(` `$r` `, ` `$x` `) ` `{ ` ` ` `echo` `"The length of the chord"` `, ` ` ` `" of the circle is "` ` ` `,2 * ` `$r` `* sin(` `$x` `* (3.14 / 180)) ; ` ` ` `} ` ` ` `// Driver code ` ` ` `$r` `= 4; ` `$x` `= 63; ` ` ` `length_of_chord(` `$r` `, ` `$x` `); ` ` ` ` ` `// This code is contributed by Ryuga ` ` ` `?> ` |

*chevron_right*

*filter_none*

**Output:**

The length of the chord of the circle is 7.12603

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the **DSA Self Paced Course** at a student-friendly price and become industry ready.

## Recommended Posts:

- Angle subtended by the chord to center of the circle when the angle subtended by the another equal chord of a congruent circle is given
- Angle subtended by the chord when the angle subtended by another chord of same length is given
- Program to calculate angle on circumference subtended by the chord when the central angle subtended by the chord is given
- Distance of chord from center when distance between center and another equal length chord is given
- Length of the chord the circle if length of the another chord which is equally inclined through the diameter is given
- Nth angle of a Polygon whose initial angle and per angle increment is given
- Angle subtended by an arc at the centre of a circle
- Angle between a chord and a tangent when angle in the alternate segment is given
- Radii of the three tangent circles of equal radius which are inscribed within a circle of given radius
- Find area of the larger circle when radius of the smaller circle and difference in the area is given
- Program to calculate area of inner circle which passes through center of outer circle and touches its circumference
- Area of Triangle using Side-Angle-Side (length of two sides and the included angle)
- Exterior angle of a cyclic quadrilateral when the opposite interior angle is given
- Radius of the circle when the width and height of an arc is given
- Angular Sweep (Maximum points that can be enclosed in a circle of given radius)
- Find the Diameter or Longest chord of a Circle
- Shortest distance from the centre of a circle to a chord
- Count ways to divide circle using N non-intersecting chord | Set-2
- Equation of circle from centre and radius
- Length of diagonals of a Rhombus using length of Side and vertex Angle

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.