JavaScript is disabled on your browser.
Skip navigation links
org.htmlunit.util.geometry

Class Polygon2D

  • All Implemented Interfaces:
    Shape2D


    public class Polygon2D
    extends Object
    implements Shape2D 
    Simple 2D shape polygon.
    Author:
    Ronald Brill
    • Constructor Detail

      • Polygon2D

        public Polygon2D(double startX,
         double startY)
        Ctor.
        Parameters:
        startX - the x value of the first point.
        startY - the Y value of the first point.
        See Also:
        lineTo(double, double)
    • Method Detail

      • lineTo

        public Polygon2D lineTo(double x,
         double y)
        Add another corner Point to the polygon.
        Parameters:
        x - the x value of the corner to be added
        y - the y value of the corner to be added
        Returns:
        this to support fluent style construction
      • contains

        public boolean contains(double x,
         double y)
        Specified by:
        contains in interface Shape2D
        Parameters:
        x - point x value
        y - point y value
        Returns:
        true if the specified point is inside; false otherwise.
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface Shape2D
        Returns:
        true if the Shape is empty.
Skip navigation links

Copyright © 2002–2025 Gargoyle Software Inc.. All rights reserved.

AltStyle によって変換されたページ (->オリジナル) /