Given a circle which has a chord inside it. The length of the chord and the radius of the circle are given. The task is to find the shortest distance from the chord to the centre.
Input: r = 4, d = 3 Output: 3.7081 Input: r = 9.8, d = 7.3 Output: 9.09492
from pythagorus theorem,
OB^2 + (d/2)^2 = r^2
so, OB = √(r^2 – d^2/4)
Below is the implementation of the above approach:
The leshortest distance from the chord to centre 3.7081
- Shortest distance between a point and a circle
- Length of the chord of the circle whose radius and the angle subtended at the center by the chord is given
- 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
- 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
- Equation of circle from centre and radius
- Find the Diameter or Longest chord of a Circle
- Distance between centers of two intersecting circles if the radii and common chord length is given
- Shortest distance between a Line and a Point in a 3-D plane
- Find the shortest distance between any pair of two different good nodes
- Check whether it is possible to join two points given on circle such that distance between them is k
- Shortest distance to every other character from given character
- Angle subtended by the chord when the angle subtended by another chord of same length is given
- Program to calculate area of inner circle which passes through center of outer circle and touches its circumference
- Check if a circle lies inside another circle or not
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.