testRayCircle

Test whether the ray with the given <code>origin</code> and direction <code>dir</code> intersects the circle with the given <code>center</code> and square radius. <p> This method returns <code>true</code> for a ray whose origin lies inside the circle. <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 origin the ray's origin @param dir the ray's direction @param center the circle's center @param radiusSquared the circle radius squared @return <code>true</code> if the ray intersects the circle; <code>false</code> otherwise

  1. bool testRayCircle(double originX, double originY, double dirX, double dirY, double centerX, double centerY, double radiusSquared)
  2. bool testRayCircle(Vector2d origin, Vector2d dir, Vector2d center, double radiusSquared)
    public static
    bool
    testRayCircle

Meta