To find the surface area of a cone, you can use the formula:
SA = πr² + πr√(r² + h²)
Where r
is the radius of the base and h
is the height of the cone.
Here's the implementation in TypeScript:
index.ts317 chars8 lines
To use this function, simply call it with the radius and height of the cone:
index.ts146 chars5 lines
In this example, the surface area of a cone with a radius of 5 and height of 10 is approximately 235.62 square units.
gistlibby LogSnag