fuookami.ospf.kotlin.utils.physics.quantity.Quantity.kt Maven / Gradle / Ivy
package fuookami.ospf.kotlin.utils.physics.quantity
/*
class Quantity(val value: T, val unit: PhysicsUnit): Arithmetic where T: Arithmetic {
}
operator fun Quantity.plus(rhs: Quantity): Quantity where T: Arithmetic, T: Invariant, U: Arithmetic, T: Plus {
return Quantity(value + rhs.value, this.unit + rhs.unit)
}
operator fun Quantity.minus(rhs: Quantity): Quantity where T: Arithmetic, T: Invariant, T: Minus {
return Quantity(value - rhs.value, this.unit - rhs.unit)
}
operator fun Quantity.times(rhs: Quantity): Quantity where T: Arithmetic, T: Invariant, T: Times {
return Quantity(value * rhs.value, this.unit * rhs.unit)
}
operator fun Quantity.div(rhs: Quantity): Quantity where T: Arithmetic, T: Invariant, T: Div {
return Quantity(value / rhs.value, this.unit / rhs.unit)
}
*/