Advertisement
Spocoman

Cone

Jan 4th, 2022
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function cone(radius, height) {
  2.  
  3.     let volume = Math.PI * radius * radius * height / 3;
  4.     let area = Math.PI * radius * ( radius + Math.sqrt(radius * radius + height * height));
  5.     console.log(`volume = ${volume.toFixed(4)}`);
  6.     console.log(`area = ${area.toFixed(4)}`);
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement