code: public static boolean intersectRaySphere(Rayd ray, Spheref sphere, Vector2d result) {
          return intersectRaySphere(ray.oX, ray.oY, ray.oZ, ray.dX, ray.dY, ray.dZ, sphere.x, sphere.y, sphere.z, sphere.r*sphere.r, result);
      }
docs: Test whether the given ray intersects the given sphere,
  and store the values of the parameter <i>t</i> in the ray equation <i>p(t) = origin + t * dir</i> for both points (near
  and far) of intersections into the given <code>result</code> vector.
  <p>
  This method returns <code>true</code> for a ray whose origin lies inside the sphere.
  <p>
  Reference: <a href="http://www.scratchapixel.com/lessons/3d-basic-rendering/minimal-ray-tracer-rendering-simple-shapes/ray-sphere-intersection">http://www.scratchapixel.com/</a>
  
  @param ray
  the ray
  @param sphere
  the sphere
  @param result
  a vector that will contain the values of the parameter <i>t</i> in the ray equation
  <i>p(t) = origin + t * dir</i> for both points (near, far) of intersections with the sphere
  @return <code>true</code> if the ray intersects the sphere; <code>false</code> otherwise