Open In App

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

Last Updated : 07 Jun, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

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 = 1 
Output: The radius of the circle is 2.5

Input: d = 14, h = 8
Output: 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 
    r = d^2/8h + h/2

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;
}

                    

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 */

                    

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

                    

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

                    

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
?>

                    

Javascript

<script>
 
// Javascript 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)
{
    document.write("The radius of the circle is "
    +((d * d) / (8 * h) + h / 2));
}
 
// Driver code
    var d = 4, h = 1;
    rad(d, h);
 
</script>

                    

Output:

The radius of the circle is 2.5

Time Complexity: O(1)

Auxiliary Space: O(1)



Similar Reads

Radii of the three tangent circles of equal radius which are inscribed within a circle of given radius
Given here is a circle of a given radius. Inside it, three tangent circles of equal radius are inscribed. The task is to find the radii of these tangent circles. Examples: Input: R = 4Output: 1.858 Input: R = 11Output: 5.1095 Approach: Let the radii of the tangent circles be r, and the radius of the circumscribing circle is R.x is the smaller dista
3 min read
Find area of the larger circle when radius of the smaller circle and difference in the area is given
Given two integers r and d where r is the radius of the smaller circle and d is the difference of the area of this circle with some larger radius circle. The task is to find the area of the larger circle.Examples: Input: r = 4, d = 5 Output: 55.24 Area of the smaller circle = 3.14 * 4 * 4 = 50.24 55.24 - 50.24 = 5Input: r = 12, d = 3 Output: 455.16
4 min read
Angle subtended by an arc at the centre of a circle
Given the angle subtended by an arc at the circle circumference X, the task is to find the angle subtended by an arc at the centre of a circle.For eg in the below given image, you are given angle X and you have to find angle Y. Examples: Input: X = 30 Output: 60Input: X = 90 Output: 180 Approach: When we draw the radius AD and the chord CB, we get
3 min read
Find the radius of the circles which are lined in a row, and distance between the centers of first and last circle is given
Given here are n circles which touch each other externally, and are lined up in a row. The distance between the centers of the first and last circle is given. The circles have a radius of equal length. The task is to find the radius of each circle. Examples: Input: d = 42, n = 4 Output: The radius of each circle is 7 Input: d = 64, n = 5 Output: Th
3 min read
Length of the chord of the circle whose radius and the angle subtended at the center by the chord is given
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 = 63 Output: 4.17809 Input:: r = 9, x = 71 Output:: 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 b
4 min read
Percentage increase in the cylinder if the height is increased by given percentage but radius remains constant
Given here is a right circular cylinder, whose height increases by a given percentage, but radius remains constant. The task is to find the percentage increase in the volume of the cylinder.Examples: Input: x = 10 Output: 10% Input: x = 18.5 Output: 18.5% Approach: Let, the radius of the cylinder = rheight of the cylinder = hgiven percentage increa
3 min read
Radius of a circle having area equal to the sum of area of the circles having given radii
Given two integers r1 and r2, representing the radius of two circles, the task is to find the radius of the circle having area equal to the sum of the area of the two circles having given radii. Examples: Input:r1 = 8r2 = 6Output:10Explanation:Area of circle with radius 8 = 201.061929 Area of a circle with radius 6 = 113.097335Area of a circle with
5 min read
Angular Sweep (Maximum points that can be enclosed in a circle of given radius)
Given ‘n’ points on the 2-D plane, find the maximum number of points that can be enclosed by a fixed-radius circle of radius ‘R’. Note: The point is considered to be inside the circle even when it lies on the circumference. Examples:  Input: R = 1 points[] = {(6.47634, 7.69628), (5.16828 4.79915), (6.69533 6.20378)}Output: 2The maximum number of po
15 min read
Equation of circle from center and radius
Given the center of circle (x1, y1) and its radius r, find the equation of the circle having center (x1, y1) and having radius r.Examples: Input : x1 = 2, y1 = -3, r = 8 Output : x^2 + y^2 - 4*x + 6*y = 51.Input : x1 = 0, y1 = 0, r = 2 Output : x^2 + y^2 - 0*x + 0*y = 4. Approach: Given the center of circle (x1, y1) and its radius r, we have to fin
5 min read
Sum of area of alternative concentric circle with radius 1,2,3,4..........N
Given that Concentric circle of radii 1,2,3,4..........N cm are drawn. The interior of the smallest circle is colored white and angular regions are colored alternately green and white so that no two adjacent regions are of the same color. The task is to find the total area of the green region in sq cm. Examples: Input: N=100Output: 15865.0429006284
5 min read
Article Tags :
Practice Tags :