ConvexShape

interface ConvexShape<V : Vector<V>, A : Transformation<V>> : Shape<V, A>

A convex Shape.

This interface models a property instead of an object, this may be unusual but consider it as a contract: interfaces are often said to be contracts the implementor has to comply, the contract defined by this interface implies convexity.

Inheritors

Properties

Link copied to clipboard
abstract val centroid: V

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.

Functions

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

Check if the shape contains a vector.

Link copied to clipboard
abstract fun intersects(other: Shape<V, 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): Shape<V, A>

Transforms the shape.