TZinovieva

Cone

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