io.data2viz.voronoi.Site.kt Maven / Gradle / Ivy
package io.data2viz.voronoi
import io.data2viz.geom.Point
class Site(val pos: Point, val index: Int) : Comparable {
val x: Double
get() = pos.x
val y: Double
get() = pos.y
override fun compareTo(other: Site) = when {
other.pos.y < pos.y -> -1
other.pos.y > pos.y -> 1
other.pos.x < pos.x -> -1
other.pos.x > pos.x -> 1
else -> 0
}
override fun toString(): String {
return "Site(pos=$pos, index=$index)"
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy