Properties

Link copied to clipboard
Link copied to clipboard
abstract val diameter: Double
Link copied to clipboard
open val radius: Double

Functions

Link copied to clipboard
abstract fun addVertex(index: Int, x: Double, y: Double): Boolean

Adds a vertex to the polygon.

Link copied to clipboard
abstract fun advanceEdge(index: Int, step: Double): Boolean

Advances an edge in its normal direction.

Link copied to clipboard
abstract fun asAwtShape(): Shape
Link copied to clipboard

Finds the edge of the polygon closest to the provided segment, i.e. the first one that would collide (= intersect) with the segment in case the polygon extended on each side.

Link copied to clipboard
abstract override fun contains(vector: Euclidean2DPosition): Boolean

Checks if the polygon contains a vector (= a point). The definition of insideness may vary depending on the implementation, this may affect the outcome for points lying on the polygon's boundary. For accurate operations see containsBoundaryIncluded and containsBoundaryExcluded.

abstract fun contains(shape: Shape): Boolean

Checks if the polygon contains a polygonal java.awt.Shape (i.e. without curved segments). A polygonal shape is contained in a polygon if all of its points are contained in (or lie on the boundary of) the latter.

Link copied to clipboard

Checks if a vector (= a point) is contained in the polygon, boundary excluded.

Link copied to clipboard

Checks if a vector (= a point) is contained in the polygon or lies on its boundary.

Link copied to clipboard
Link copied to clipboard
abstract fun extend(step: Double): Boolean

Extends the polygon in each direction: each edge is given a chance to advance.

Link copied to clipboard
abstract fun getEdge(index: Int): Segment2D<Euclidean2DPosition>

Depending on the implementation, this may be faster than edges.get(index).

Link copied to clipboard

Checks if a segment intersects with the polygon, segments lying on the polygon's boundary are not considered to be intersecting.

abstract fun intersects(shape: Shape): Boolean

Checks if a java.awt.Shape intersects the polygon, adjacent shapes are not considered to be intersecting.

Link copied to clipboard
abstract fun isAdjacentTo(other: ConvexPolygon): Boolean

A polygon is adjacent to another if any of its points lies on the boundary of the other.

Link copied to clipboard

Checks if a vector (= a point) lies on the polygon's boundary.

Link copied to clipboard
abstract fun moveVertex(index: Int, newX: Double, newY: Double): Boolean

Moves a vertex of the polygon to a new absolute position.

Link copied to clipboard
abstract fun removeVertex(index: Int): Boolean

Removes a vertex from the polygon.

Link copied to clipboard
abstract fun replaceEdge(index: Int, newEdge: Segment2D<Euclidean2DPosition>): Boolean

Replaces an edge of the polygon.

Link copied to clipboard
Link copied to clipboard