Find Angle at Circumference from Angle at Centre by a Chord in Java?


A circle is a round shape two-dimensional diagram which has no corners. Every circle has an origin point and every point on the circle maintains equal distance from the origin. The distance between the origin and a point in a circle is known as Radius of the circle.

And similarly, if we draw a line from one edge to another edge of the circle and the origin is held in the middle of it, that line is known as diameter of the circle. Basically, the diameter is double of the length of the radius.

Chord of the circle refers to a line touching from one endpoint of circle to another end point of circle. Or simply we can say a chord refers to the line whose endpoints lie on the circle. A chord divides the circle into two parts.

The angle at the centre subtended by the chord is double of the angle at the
circumference of the circle by the same chord.
So, if the angle on centre is given as ‘a’ then the angle on circumference will
be a/2

As per the problem statement we have to find the angle at circumference subtended by the chord when the angle at centre is subtended by the same chord.

So, let's explore.

To Show You Some Instances

Instance-1

Let say angle at the centre subtended by the chord is 60

Then by using the formula, the angle at circumference subtended by the same chord is 30.

Instance-2

Let say angle at the centre subtended by the chord is 65

Then by using the formula, the angle at circumference subtended by the same chord is 32.5.

Instance-3

Let say angle at the centre subtended by the chord is 70

Then by using the formula, the angle at circumference subtended by the same chord is 35.

Algorithm

  • Step 1 − Get the angle at the centre subtended by the chord either by static input or by user input.

  • Step 2 − Find the angle at circumference subtended by the same chord by using the formula.

  • Step 3 − Print the result.

Multiple Approaches

We have provided the solution in different approaches.

  • By Using Static Input Value

  • By Using User-Defined Method

  • By Using User Input Value

Let’s see the program along with its output one by one.

Approach-1: By Using Static Input Value

Example

In this approach, we declare a double variable and initialize it with the angle at centre. Then by using the algorithm we can find the angle on circumference.

public class Main{
   //main method
   public static void main(String[] args){
      //angle at the centre subtended by the chord 
      float a= 80;
      //find the angle on circumference subtended by the same chord
      float result = a / 2;
      System.out.println("Angle on circumference subtended by the same chord: "+result);
   }
}

Output

Angle on circumference subtended by the same chord: 40.0

Approach-2: By Using User Defined Method

Example

In this approach, we declare a double variable and initialize it with the angle at centre. Then call a user defined method by passing this angle as parameter and inside the method using the algorithm, we can find the angle on circumference.

public class Main{

   //main method
   public static void main(String[] args){
   
      //angle at the centre subtended by the chord 
      float a= 70;
      float result = angleOncirCumference(a);
      System.out.println("Angle on circumference subtended by the same chord: "+result);
   }
   
   //user defined method to find the angle 
   //on circumference subtended by the same chord
   static float angleOncirCumference(float a){
      return (a / 2);
   }
}

Output

Angle on circumference subtended by the same chord: 35.0

Approach-3: By Using User Input Value

In this approach, we declare a double variable and take the user input of angle at centre subtended by the chord. Then by using the algorithm find the angle on circumference subtended by the same chord.

import java.util.*;
public class Main{

   //main method
   public static void main(String[] args){
   
      //Create the object of Scanner class
      Scanner sc = new Scanner(System.in);
      
      //take user input of angle at the centre subtended by the chord 
      System.out.println("Enter the angle on centre subtended by chord: ");
      float a= sc.nextFloat();
      
      //find the angle on circumference subtended by the same chord
      float result = a / 2;
      System.out.println("Angle on circumference subtended by the same chord: "+result);
   }
}

Output

Enter the angle on centre subtended by chord: 
90
Angle on circumference subtended by the same chord: 45.0

In this article, we explored how to find the angle on circumference subtended by the chord when the angle on centre subtended by the same chord is given by using different approaches in Java.

Updated on: 05-Jan-2023

56 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements