# Companion

object Companion

## Properties

COLOR_SIMILARITY_THRESHOLD
Link copied to clipboard
const val COLOR_SIMILARITY_THRESHOLD: Float = 0.5f
SHARE_OF_ZOOM_FACTOR
Link copied to clipboard
const val SHARE_OF_ZOOM_FACTOR: Float = 0.15f

## Functions

calcCenterOfMass
Link copied to clipboard
fun calcCenterOfMass(points: Array<Point2D>): Point2D

Returns a Point2D object that represents the center of mass of the given point array which represents a polygon.

findEnclosedRectangle
Link copied to clipboard
fun findEnclosedRectangle(shape: Shape, y: Int, height: Int): Rectangle
getArea
Link copied to clipboard
fun getArea(shape: Shape?): Double
getCentroid
Link copied to clipboard
fun getCentroid(shape: Shape): Point2D

Returns a Point2D object that represents the center of mass of the given shape.

getPoints
Link copied to clipboard
fun getPoints(shape: Shape): Array<Point2D>