alchemist-interfaces / it.unibo.alchemist.model.interfaces.geometry / GeometricShape

GeometricShape

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

Models a generic shape.

Parameters

Parameters

Properties

centroid

The geometric center.

abstract val centroid: S

diameter

The largest distance between any pair of vertices.

abstract val diameter: Double

Functions

contains

Check if the shape contains a vector.

abstract fun contains(vector: S): Boolean

intersects

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

abstract fun intersects(other: GeometricShape<S, A>): Boolean

transformed

Transforms the shape.

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