To find the surface area of a regular polygon inscribed in a pyramid, we need to find the area of each triangular face of the pyramid, and then sum those areas. Here's the PHP code to do that:
main.php727 chars19 linesYou can input different values for $n, $s, and $h to calculate the surface area of different pyramids with different regular polygon inscriptions.
gistlibby LogSnag