Skip to content
Advertisement

Get a radius of a circle in bash shell

I need to write a script to find radius of a circle and then find the area while the circumference is given

JavaScript

The formula is: RADIUS=CIRCUMFERENCE/(2 * PI) The problem is I cant make this formula work because bash doesn’t accept decimal division I read a lot of answers there but still can’t get what I want

I have something like

JavaScript

was trying a lot of different variants,used bc -l but still can’t do it right and there are always a mistakes

Advertisement

Answer

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement