Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; plgContentJComments has a deprecated constructor in /var/www/astarmathsandphysics/plugins/content/jcomments/jcomments.php on line 25 Call Stack: 0.0001 362584 1. {main}() /var/www/astarmathsandphysics/index.php:0 0.0830 1213480 2. Joomla\CMS\Application\SiteApplication->execute() /var/www/astarmathsandphysics/index.php:49 0.0830 1213480 3. Joomla\CMS\Application\SiteApplication->doExecute() /var/www/astarmathsandphysics/libraries/src/Application/CMSApplication.php:267 0.1537 4112784 4. Joomla\CMS\Application\SiteApplication->dispatch() /var/www/astarmathsandphysics/libraries/src/Application/SiteApplication.php:233 0.1551 4140464 5. Joomla\CMS\Component\ComponentHelper::renderComponent() /var/www/astarmathsandphysics/libraries/src/Application/SiteApplication.php:194 0.1558 4158176 6. Joomla\CMS\Component\ComponentHelper::executeComponent() /var/www/astarmathsandphysics/libraries/src/Component/ComponentHelper.php:356 0.1558 4175184 7. require_once('/var/www/astarmathsandphysics/components/com_content/content.php') /var/www/astarmathsandphysics/libraries/src/Component/ComponentHelper.php:381 0.1565 4182920 8. ContentController->execute() /var/www/astarmathsandphysics/components/com_content/content.php:42 0.1566 4182920 9. ContentController->display() /var/www/astarmathsandphysics/libraries/src/MVC/Controller/BaseController.php:710 0.2332 4807752 10. ContentController->display() /var/www/astarmathsandphysics/components/com_content/controller.php:113 0.2354 4892984 11. Joomla\CMS\Cache\Controller\ViewController->get() /var/www/astarmathsandphysics/libraries/src/MVC/Controller/BaseController.php:663 0.2458 4913912 12. ContentViewArticle->display() /var/www/astarmathsandphysics/libraries/src/Cache/Controller/ViewController.php:102 0.2563 5071472 13. Joomla\CMS\Plugin\PluginHelper::importPlugin() /var/www/astarmathsandphysics/components/com_content/views/article/view.html.php:189 0.2563 5071728 14. Joomla\CMS\Plugin\PluginHelper::import() /var/www/astarmathsandphysics/libraries/src/Plugin/PluginHelper.php:182

Maximum Radius of Sphere Inside a Square Based Pyramid

For a square based pyramid with apex above the centre of the base, a sphere of maximum radius will meet the base at the centre, and each slanted face tangentially.
For the diagram below, if  
\[\]
  is the angle in the triangle ABC subtended by the radius of the circle from the midpoint of a side of the base, then  
\[tan \alpha = \frac{r}{x/2} = \frac{2r}{x}\]
.

The triangle ACD has a side AC in common, both have right angles opposite this side and radius of the sphere as another side, so are congruent. Angle DAC is the  
\[\alpha\]
  and angle DAB is  
\[2 \alpha\]
.
From the diagram,  
\[tan 2 \alpha = \frac{h}{2/x} = \frac{2h}{x}\]
.
Now use the identity  
\[tan 2 \alpha = \frac{2 tan \alpha}{1- tan^2 \alpha}\]
  to obtain
\[\frac{2h}{x} = \frac{4r/x}{1-(2r/x)^2} = \frac{4rx}{x^2 - 4r^2}\]

We can rearrange this as a quadratic in  
\[r\]
, obtaining
\[8hr^2+4rx^2-2hx^2=0\]
.
Solving this gives  
\[r=\frac{-4x^2 \pm \sqrt{16x^4 +64h^2x^2}}{16h} = \frac{-x^2 \pm x \sqrt{x^2+4h^2}}{4h}\]

Only the  
\[+\]
  option gives a valid value of  
\[r\]
  so  
\[r= \frac{-x^2 + x \sqrt{x^2+4h^2}}{4h}\]