package net.shadowfacts.cacao.geometry /** * Helper class for defining 2D points. * * @author shadowfacts */ data class Point(val x: Double, val y: Double) { constructor(x: Int, y: Int): this(x.toDouble(), y.toDouble()) companion object { val ORIGIN = Point(0.0, 0.0) } operator fun plus(other: Point): Point { return Point(x + other.x, y + other.y) } operator fun minus(other: Point): Point { return Point(x - other.x, y - other.y) } }