Skip to content

Latest commit

 

History

History
16 lines (12 loc) · 490 Bytes

area_of_a_square.md

File metadata and controls

16 lines (12 loc) · 490 Bytes

Description

Complete the function that calculates the area of the red square, when the length of the circular arc A is given as the input. Return the result rounded to two decimals.

Note: use the π value provided in your language (Math::PI, M_PI, math.pi, etc)

My Solution

def square_area(arc)
  ((2 * arc /  Math::PI) ** 2).round(2)
end