# Radius of the circle when the width and height of an arc is given

Given a circle in which the width and height of an arc are given. The task is to find the radius of the circle with the help of the width and height of the arc.

**Examples:**

Input:d = 4, h = 1Output:The radius of the circle is 2.5Input:d = 14, h = 8Output:The radius of the circle is 7.0625

**Approach**

- Let the radius of the circle be
**r** - Let the height and width of the arc be
**h**&**d** - Now, the diameter DC bisects the chord AB in two halves, each having length
**d/2** - Also the diameter is divided by the chord in two parts, the part inside arc
**h**and the remaining**2r-h** - Now from intersecting chords theorem,

**h*(2r-h) = (d/2)^2**

or, 2rh – h^2 = d^2/4

so, r = d^2/8h + h/2 - So, radius of the circle

- 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
- Number of rectangles in a circle of radius R
- Equation of circle from centre and radius
- Find minimum radius such that atleast k point lie inside the circle
- Angular Sweep (Maximum points that can be enclosed in a circle of given radius)
- Percentage increase in the cylinder if the height is increased by given percentage but radius remains constant
- Radius of the biggest possible circle inscribed in rhombus which in turn is inscribed in a rectangle
- Length of the chord of the circle whose radius and the angle subtended at the center by the chord 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
- Equation of circle when three points on the circle are given
- Maximize a value for a semicircle of given radius
- Program to find the Radius of the incircle of the triangle
- Area of a n-sided regular polygon with given Radius

Below is the implementation of the above approach:

## C++

`// C++ program to find ` `// radius of the circle ` `// when the width and height ` `// of an arc is given ` ` ` `#include <bits/stdc++.h> ` `using` `namespace` `std; ` ` ` `// Function to find the radius ` `void` `rad(` `double` `d, ` `double` `h) ` `{ ` ` ` `cout << ` `"The radius of the circle is "` ` ` `<< ((d * d) / (8 * h) + h / 2) ` ` ` `<< endl; ` `} ` ` ` `// Driver code ` `int` `main() ` `{ ` ` ` `double` `d = 4, h = 1; ` ` ` `rad(d, h); ` ` ` `return` `0; ` `} ` |

*chevron_right*

*filter_none*

## Java

`// Java program to find ` `// radius of the circle ` `// when the width and height ` `// of an arc is given ` `class` `GFG ` `{ ` ` ` `// Function to find the radius ` `static` `void` `rad(` `double` `d, ` `double` `h) ` `{ ` ` ` `System.out.println( ` `"The radius of the circle is "` ` ` `+ ((d * d) / (` `8` `* h) + h / ` `2` `)); ` `} ` ` ` `// Driver code ` `public` `static` `void` `main(String[] args) ` `{ ` ` ` `double` `d = ` `4` `, h = ` `1` `; ` ` ` `rad(d, h); ` `} ` `} ` ` ` `/* This code contributed by PrinciRaj1992 */` |

*chevron_right*

*filter_none*

## Python3

`# Python3 program to find ` `# radius of the circle ` `# when the width and height ` `# of an arc is given ` ` ` `# Function to find the radius ` `def` `rad(d, h): ` ` ` `print` `(` `"The radius of the circle is"` `, ` ` ` `((d ` `*` `d) ` `/` `(` `8` `*` `h) ` `+` `h ` `/` `2` `)) ` ` ` `# Driver code ` `d ` `=` `4` `; h ` `=` `1` `; ` `rad(d, h); ` ` ` `# This code is contributed by 29AjayKumar ` |

*chevron_right*

*filter_none*

## C#

`// C# program to find ` `// radius of the circle ` `// when the width and height ` `// of an arc is given ` `using` `System; ` ` ` `class` `GFG ` `{ ` ` ` `// Function to find the radius ` `static` `void` `rad(` `double` `d, ` `double` `h) ` `{ ` ` ` `Console.WriteLine( ` `"The radius of the circle is "` ` ` `+ ((d * d) / (8 * h) + h / 2)); ` `} ` ` ` `// Driver code ` `public` `static` `void` `Main() ` `{ ` ` ` `double` `d = 4, h = 1; ` ` ` `rad(d, h); ` `} ` `} ` ` ` `// This code is contributed by AnkitRai01 ` |

*chevron_right*

*filter_none*

## PHP

`<?php ` `// PHP program to find radius of ` `// the circle when the width and ` `// height of an arc is given ` ` ` `// Function to find the radius ` `function` `rad(` `$d` `, ` `$h` `) ` `{ ` ` ` `echo` `"The radius of the circle is "` `, ` ` ` `((` `$d` `* ` `$d` `) / (8 * ` `$h` `) + ` `$h` `/ 2), ` `"\n"` `; ` `} ` ` ` `// Driver code ` `$d` `= 4; ` `$h` `= 1; ` `rad(` `$d` `, ` `$h` `); ` ` ` `// This code is contributed by ajit ` `?> ` |

*chevron_right*

*filter_none*

**Output:**

The radius of the circle is 2.5

## Recommended Posts:

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.