VOOZH about

URL: https://www.geeksforgeeks.org/dsa/arc-length-angle/

⇱ Arc length from given Angle - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Arc length from given Angle

Last Updated : 17 Feb, 2023

An angle is a geometrical figure when two rays meet at a common point on a plane. These rays form the sides of the angle and the meeting point is referred as the vertex of the angle. There is something that we need to keep in mind that the plane that forms an angle doesn't need to be a Euclidean plane. Now, in a circle, the length of an arc is a portion of the circumference. The figure explains the various parts we have discussed: 
 

👁 Arc length from given Angle


Given an angle and the diameter of a circle, we can calculate the length of the arc using the formula: 
 

ArcLength = ( 2 * pi * radius ) * ( angle / 360 )
Where pi = 22/7,
diameter = 2 * radius,
angle is in degree.


Examples : 
 

Input : 
Diameter = 25
Angle = 45
Explanation : ((22/7) * 25) * (45/360)
Output : 9.821 (rounded)

Input : 
Diameter = 80
Angle = 60
Explanation : ((22/7) * 80) * (60/360)
Output : 41.905 (rounded)


Note: If angle is greater than or equal to 360 degree, then the arc length cannot be calculated, since no angle is possible.
 


 

Output: 

9.821428571428571

Time Complexity: O(1)
Auxiliary Space: O(1)


 

Comment
Article Tags: