js-mentorship-razvan / javascript

Javascript study notes
GNU General Public License v3.0
22 stars 2 forks source link

Circle area inside square #610

Closed RazvanBugoi closed 2 years ago

RazvanBugoi commented 2 years ago

https://www.codewars.com/kata/5899aa695401a83a5c0000c4/train/javascript

RazvanBugoi commented 2 years ago
function squareAreaToCircle(size){
  const squareWidth = Math.sqrt(size)

  return Math.pow(squareWidth / 2, 2) * Math.PI 
}