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