Module org.htmlunit

Class Circle2D

java.lang.Object
org.htmlunit.util.geometry.Circle2D
All Implemented Interfaces:
Shape2D

public class Circle2D extends Object implements Shape2D
Simple 2D circle shape.
Author:
Ronald Brill
  • Field Summary

    Fields inherited from interface org.htmlunit.util.geometry.Shape2D

    EPSILON
  • Constructor Summary

    Constructors
    Constructor
    Description
    Circle2D(double centerX, double centerY, double radius)
    Creates a new circle with the given center and radius.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    contains(double x, double y)
    Returns whether the specified point lies inside this shape.
    boolean
    Returns whether this shape is empty.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Circle2D

      public Circle2D(double centerX, double centerY, double radius)
      Creates a new circle with the given center and radius.
      Parameters:
      centerX - the x coordinate of the center
      centerY - the y coordinate of the center
      radius - the radius
  • Method Details

    • contains

      public boolean contains(double x, double y)
      Returns whether the specified point lies inside this shape.
      Specified by:
      contains in interface Shape2D
      Parameters:
      x - the x coordinate of the point to test
      y - the y coordinate of the point to test
      Returns:
      true if the point is inside this shape; false otherwise
    • isEmpty

      public boolean isEmpty()
      Returns whether this shape is empty.
      Specified by:
      isEmpty in interface Shape2D
      Returns:
      true if this shape is empty; false otherwise
    • toString

      public String toString()
      Overrides:
      toString in class Object