Skip to content

Commit

Permalink
Created frequency measured in hertz to base units
Browse files Browse the repository at this point in the history
  • Loading branch information
AJaiman committed Jul 1, 2024
1 parent 9e5007c commit b2a558d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 41 deletions.
6 changes: 1 addition & 5 deletions src/main/kotlin/org/team4099/lib/units/Derivatives.kt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
package org.team4099.lib.units

import org.team4099.lib.units.base.METERS_PER_FOOT
import org.team4099.lib.units.base.METERS_PER_INCH
import org.team4099.lib.units.base.Meter
import org.team4099.lib.units.base.SECONDS_PER_MINUTE
import org.team4099.lib.units.base.Second
import org.team4099.lib.units.base.*
import org.team4099.lib.units.derived.Radian
import kotlin.math.PI

Expand Down
36 changes: 0 additions & 36 deletions src/main/kotlin/org/team4099/lib/units/base/Cycle.kt

This file was deleted.

16 changes: 16 additions & 0 deletions src/main/kotlin/org/team4099/lib/units/base/Frequency.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.team4099.lib.units.base

import org.team4099.lib.units.UnitKey
import org.team4099.lib.units.Value

object Hertz: UnitKey
typealias Frequency = Value<Hertz>

inline val Double.hertz: Frequency
get() = Frequency(this)

inline val Number.hertz: Frequency
get() = toDouble().hertz

inline val Frequency.inHertz: Double
get() = value

0 comments on commit b2a558d

Please sign in to comment.