All Downloads are FREE. Search and download functionalities are using the official Maven repository.

fuookami.ospf.kotlin.utils.math.geometry.Edge.kt Maven / Gradle / Ivy

There is a newer version: 1.0.29
Show newest version
package fuookami.ospf.kotlin.utils.math.geometry

import fuookami.ospf.kotlin.utils.math.*

data class Edge

, D : Dimension>( val from: P, val to: P ) { init { assert(from.size == to.size) } val length by lazy { from distance to } fun length(distance: Distance = Distance.Euclidean): Flt64 { return distance(from, to) } val vector by lazy { Vector(from.indices.map { to[it] - from[it] }, from.dim) } override fun toString() = "$from -> $to" } typealias Edge2 = Edge typealias Edge3 = Edge





© 2015 - 2024 Weber Informatics LLC | Privacy Policy