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

fuookami.ospf.kotlin.utils.physics.quantity.Quantity.kt Maven / Gradle / Ivy

There is a newer version: 1.0.29
Show newest version
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)
}
*/