| 6 | * @param {number} height - The height of the cone |
| 7 | */ |
| 8 | export default class Cone { |
| 9 | constructor(baseRadius, height) { |
| 10 | this.baseRadius = baseRadius |
| 11 | this.height = height |
| 12 | } |
| 13 | |
| 14 | baseArea = () => { |
| 15 | return Math.pow(this.baseRadius, 2) * Math.PI |
| 16 | } |
| 17 | |
| 18 | volume = () => { |
| 19 | return (this.baseArea() * this.height * 1) / 3 |
| 20 | } |
| 21 | |
| 22 | surfaceArea = () => { |
| 23 | return ( |
| 24 | this.baseArea() + |
| 25 | Math.PI * |
| 26 | this.baseRadius * |
| 27 | Math.sqrt(Math.pow(this.baseRadius, 2) + Math.pow(this.height, 2)) |
| 28 | ) |
| 29 | } |
| 30 | } |
nothing calls this directly
no outgoing calls
no test coverage detected