Shape

interface Shape<T : Number, Comparable<T>>

2D shape.

Since

v2.0.0

Inheritors

Functions

Link copied to clipboard
abstract operator fun contains(point: <Error class: unknown class><T>): Boolean

Returns true if given point is inside this shape.

Link copied to clipboard
abstract fun distanceTo(point: <Error class: unknown class><T>): T

Returns the distance between this shape and the given point.

Link copied to clipboard
abstract infix fun intersects(circle: Circle<T>): Boolean

Returns true if given circle intersects this shape.

abstract infix fun intersects(polygon: Polygon<T>): Boolean

Returns true if given polygon intersects this shape.

open infix fun intersects(rectangle: Rectangle<T>): Boolean

Returns true if given rectangle intersects this shape.

abstract infix fun intersects(section: Section2<T>): Boolean

Returns true if given section intersects this shape.

abstract infix fun intersects(other: Shape<T>): Boolean

Returns true if given other shape intersects this shape.

Link copied to clipboard
abstract fun rotate(angle: <Error class: unknown class><T>): Shape<T>

Returns this shape rotated by given angle around origin point.

abstract fun rotate(angle: <Error class: unknown class><T>, pivot: <Error class: unknown class><T>): Shape<T>

Returns this shape rotated by given angle around given pivot point.

Link copied to clipboard
abstract fun scale(scale: T): Shape<T>

Returns this shape scaled by given scale value relative to origin point.

abstract fun scale(scale: T, center: <Error class: unknown class><T>): Shape<T>

Returns this shape scaled by given scale value relative to given center point.

Link copied to clipboard
abstract fun translate(vector: <Error class: unknown class><T>): Shape<T>

Returns this shape translated by given vector.

Properties

Link copied to clipboard
abstract val boundingBox: Rectangle<T>

Bounding box of this shape.

Link copied to clipboard
abstract val midpoint: <Error class: unknown class><T>

Midpoint of this shape.

Link copied to clipboard
abstract val type: KClass<T>

Type of coordinates in this shape.