GeometricShape

interface GeometricShape<S : Vector<S>, A : GeometricTransformation<S>> : Serializable

Models a generic shape.

Parameters

Functions

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

Check if the shape contains a vector.

Link copied to clipboard
abstract fun intersects(other: GeometricShape<S, A>): Boolean

A shape intersects another if any of its points is contained in the other one.

Link copied to clipboard
abstract fun transformed(transformation: A.() -> Unit): GeometricShape<S, A>

Transforms the shape.

Properties

Link copied to clipboard
abstract val centroid: S

The geometric center.

Link copied to clipboard
abstract val diameter: Double

The largest distance between any pair of vertices.

Link copied to clipboard
open val radius: Double

Half the diameter.

Inheritors

Link copied to clipboard
Link copied to clipboard