title: Merge two spheres to get a new one
body: <p>How do I calculate a the smallest sphere possible that encapsulates two others spheres?</p>
  
  <p>Every sphere has a center point in 3d space and a radius.</p>
  
  <p>Edit:</p>
  
  <p>Here's my code. I'm trying to implement the merge() function but I don't know how.</p>
  
  <pre><code>#include &lt;gl\glm\glm.hpp&gt;
  
  class Sphere
  {
  public:
      Sphere();
      Sphere(const glm::vec3 &amp;point, float radius);
  
      void set(const glm::vec3 &amp;point, float radius);
      void reset();
      bool isReset() const;
  
      const glm::vec3&amp; getCenter() const { return _point; }
      float radius() const { return _radius; }
  
      void merge(const Sphere &amp;other);
  
      bool operator==(const Sphere &amp;other) const {
          return (_point == other._point &amp;&amp; _radius == other._radius);
      }
      bool operator!=(const Sphere &amp;other) const {
          return !operator==(other);
      }
  
  private:
      glm::vec3 _point;
      float _radius;
  };
  </code></pre>