Record Class Force

java.lang.Object
java.lang.Record
edu.wpi.first.units.measure.Force
All Implemented Interfaces:
Measure<ForceUnit>, Comparable<Measure<ForceUnit>>

public record Force(double magnitude, double baseUnitMagnitude, ForceUnit unit) extends Record implements Measure<ForceUnit>
  • Constructor Details

    • Force

      public Force(double magnitude, double baseUnitMagnitude, ForceUnit unit)
      Creates an instance of a Force record class.
      Parameters:
      magnitude - the value for the magnitude record component
      baseUnitMagnitude - the value for the baseUnitMagnitude record component
      unit - the value for the unit record component
  • Method Details

    • ofRelativeUnits

      public static Force ofRelativeUnits(double magnitude, ForceUnit unit)
      For doing math with measures of a known dimension but an unknown unit. Most users should use ForceUnit.of(double) on a known unit from Units instead of calling this method.
      Parameters:
      magnitude - the magnitude of the measurement in terms of the given unit
      unit - the unit of the measurement
      Returns:
      a measurement object
    • ofBaseUnits

      public static Force ofBaseUnits(double baseUnitMagnitude, ForceUnit unit)
      For doing math with measures of a known dimension but an unknown unit. Most users should use ForceUnit.of(double) on a known unit from Units instead of calling this method.
      Parameters:
      baseUnitMagnitude - the magnitude of the measurement in terms of the given unit's base unit
      unit - the unit of the measurement
      Returns:
      a measurement object
    • baseUnit

      public ForceUnit baseUnit()
      Description copied from interface: Measure
      A convenience method to get the base unit of the measurement. Equivalent to unit().getBaseUnit().
      Specified by:
      baseUnit in interface Measure<ForceUnit>
      Returns:
      the base unit of measure.
    • in

      public double in(ForceUnit unit)
      Description copied from interface: Measure
      Converts this measure to a measure with a different unit of the same type, eg minutes to seconds. Converting to the same unit is equivalent to calling Measure.magnitude().
         Meters.of(12).in(Feet) // 39.3701
         Seconds.of(15).in(Minutes) // 0.25
       
      Specified by:
      in in interface Measure<ForceUnit>
      Parameters:
      unit - the unit to convert this measure to
      Returns:
      the value of this measure in the given unit
    • equals

      public boolean equals(Object object)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      object - the object with which to compare
      Returns:
      true if this object is the same as the object argument; false otherwise.
    • unaryMinus

      public Force unaryMinus()
      Description copied from interface: Measure
      Returns a measure equivalent to this one equal to zero minus its current value. For non-linear unit types like temperature, the zero point is treated as the zero value of the base unit (eg Kelvin). In effect, this means code like Celsius.of(10).unaryMinus() returns a value equivalent to -10 Kelvin, and not -10° Celsius.
      Specified by:
      unaryMinus in interface Measure<ForceUnit>
      Returns:
      a measure equal to zero minus this measure
    • negate

      @Deprecated(since="2025", forRemoval=true) public Force negate()
      Deprecated, for removal: This API element is subject to removal in a future version.
      use unaryMinus() instead. This was renamed for consistency with other WPILib classes like Rotation2d
      Returns a measure equivalent to this one equal to zero minus its current value. For non-linear unit types like temperature, the zero point is treated as the zero value of the base unit (eg Kelvin). In effect, this means code like Celsius.of(10).negate() returns a value equivalent to -10 Kelvin, and not -10° Celsius.
      Specified by:
      negate in interface Measure<ForceUnit>
      Returns:
      a measure equal to zero minus this measure
    • plus

      public Force plus(Measure<? extends ForceUnit> other)
      Description copied from interface: Measure
      Adds another measure of the same unit type to this one.
      Specified by:
      plus in interface Measure<ForceUnit>
      Parameters:
      other - the measurement to add
      Returns:
      a measure of the sum of both measures
    • minus

      public Force minus(Measure<? extends ForceUnit> other)
      Description copied from interface: Measure
      Subtracts another measure of the same unit type from this one.
      Specified by:
      minus in interface Measure<ForceUnit>
      Parameters:
      other - the measurement to subtract
      Returns:
      a measure of the difference between the measures
    • times

      public Force times(double multiplier)
      Description copied from interface: Measure
      Multiplies this measure by a scalar unitless multiplier.
      Specified by:
      times in interface Measure<ForceUnit>
      Parameters:
      multiplier - the scalar multiplication factor
      Returns:
      the scaled result
    • div

      public Force div(double divisor)
      Description copied from interface: Measure
      Divides this measure by a unitless scalar and returns the result.
      Specified by:
      div in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • divide

      @Deprecated(since="2025", forRemoval=true) public Force divide(double divisor)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use div instead. This was renamed for consistency with other languages like Kotlin
      Divides this measure by a unitless scalar and returns the result.
      Specified by:
      divide in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • times

      public Mult<ForceUnit,AccelerationUnit<?>> times(Acceleration<?> multiplier)
      Description copied from interface: Measure
      Multiplies this measure by an acceleration and returns the resulting measure in the most appropriate unit.
      Specified by:
      times in interface Measure<ForceUnit>
      Parameters:
      multiplier - the measurement to multiply by.
      Returns:
      the multiplication result
    • div

      public Per<ForceUnit,AccelerationUnit<?>> div(Acceleration<?> divisor)
      Description copied from interface: Measure
      Divides this measure by a generic acceleration and returns the result in the most appropriate unit.
      Specified by:
      div in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • divide

      Deprecated, for removal: This API element is subject to removal in a future version.
      use div instead. This was renamed for consistency with other languages like Kotlin
      Divides this measure by a generic acceleration and returns the result in the most appropriate unit.
      Specified by:
      divide in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • per

      public Per<ForceUnit,AccelerationUnit<?>> per(AccelerationUnit<?> divisorUnit)
      Description copied from interface: Measure
      Divides this measure by an acceleration unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
      Specified by:
      per in interface Measure<ForceUnit>
      Parameters:
      divisorUnit - the unit to divide by.
      Returns:
      the division result
    • times

      public Mult<ForceUnit,AngleUnit> times(Angle multiplier)
      Description copied from interface: Measure
      Multiplies this measure by an angle and returns the resulting measure in the most appropriate unit.
      Specified by:
      times in interface Measure<ForceUnit>
      Parameters:
      multiplier - the measurement to multiply by.
      Returns:
      the multiplication result
    • div

      public Per<ForceUnit,AngleUnit> div(Angle divisor)
      Description copied from interface: Measure
      Divides this measure by an angle and returns the result in the most appropriate unit.
      Specified by:
      div in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • divide

      @Deprecated(since="2025", forRemoval=true) public Per<ForceUnit,AngleUnit> divide(Angle divisor)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use div instead. This was renamed for consistency with other languages like Kotlin
      Divides this measure by an angle and returns the result in the most appropriate unit.
      Specified by:
      divide in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • per

      public Per<ForceUnit,AngleUnit> per(AngleUnit divisorUnit)
      Description copied from interface: Measure
      Divides this measure by an angle unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
      Specified by:
      per in interface Measure<ForceUnit>
      Parameters:
      divisorUnit - the unit to divide by.
      Returns:
      the division result
    • times

      Description copied from interface: Measure
      Multiplies this measure by an angular acceleration and returns the resulting measure in the most appropriate unit.
      Specified by:
      times in interface Measure<ForceUnit>
      Parameters:
      multiplier - the measurement to multiply by.
      Returns:
      the multiplication result
    • div

      Description copied from interface: Measure
      Divides this measure by an angular acceleration and returns the result in the most appropriate unit.
      Specified by:
      div in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • divide

      Deprecated, for removal: This API element is subject to removal in a future version.
      use div instead. This was renamed for consistency with other languages like Kotlin
      Divides this measure by an angular acceleration and returns the result in the most appropriate unit.
      Specified by:
      divide in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • per

      Description copied from interface: Measure
      Divides this measure by an angular acceleration unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
      Specified by:
      per in interface Measure<ForceUnit>
      Parameters:
      divisorUnit - the unit to divide by.
      Returns:
      the division result
    • times

      Description copied from interface: Measure
      Multiplies this measure by an angular momentum and returns the resulting measure in the most appropriate unit.
      Specified by:
      times in interface Measure<ForceUnit>
      Parameters:
      multiplier - the measurement to multiply by.
      Returns:
      the multiplication result
    • div

      Description copied from interface: Measure
      Divides this measure by an angular momentum and returns the result in the most appropriate unit.
      Specified by:
      div in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • divide

      Deprecated, for removal: This API element is subject to removal in a future version.
      use div instead. This was renamed for consistency with other languages like Kotlin
      Divides this measure by an angular momentum and returns the result in the most appropriate unit.
      Specified by:
      divide in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • per

      Description copied from interface: Measure
      Divides this measure by an angular momentum unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
      Specified by:
      per in interface Measure<ForceUnit>
      Parameters:
      divisorUnit - the unit to divide by.
      Returns:
      the division result
    • times

      Description copied from interface: Measure
      Multiplies this measure by an angular velocity and returns the resulting measure in the most appropriate unit.
      Specified by:
      times in interface Measure<ForceUnit>
      Parameters:
      multiplier - the measurement to multiply by.
      Returns:
      the multiplication result
    • div

      Description copied from interface: Measure
      Divides this measure by an angular velocity and returns the result in the most appropriate unit.
      Specified by:
      div in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • divide

      Deprecated, for removal: This API element is subject to removal in a future version.
      use div instead. This was renamed for consistency with other languages like Kotlin
      Divides this measure by an angular velocity and returns the result in the most appropriate unit.
      Specified by:
      divide in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • per

      Description copied from interface: Measure
      Divides this measure by an angular velocity unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
      Specified by:
      per in interface Measure<ForceUnit>
      Parameters:
      divisorUnit - the unit to divide by.
      Returns:
      the division result
    • times

      public Mult<ForceUnit,CurrentUnit> times(Current multiplier)
      Description copied from interface: Measure
      Multiplies this measure by an electric current and returns the resulting measure in the most appropriate unit.
      Specified by:
      times in interface Measure<ForceUnit>
      Parameters:
      multiplier - the measurement to multiply by.
      Returns:
      the multiplication result
    • div

      public Per<ForceUnit,CurrentUnit> div(Current divisor)
      Description copied from interface: Measure
      Divides this measure by an electric current and returns the result in the most appropriate unit.
      Specified by:
      div in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • divide

      Deprecated, for removal: This API element is subject to removal in a future version.
      use div instead. This was renamed for consistency with other languages like Kotlin
      Divides this measure by an electric current and returns the result in the most appropriate unit.
      Specified by:
      divide in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • per

      public Per<ForceUnit,CurrentUnit> per(CurrentUnit divisorUnit)
      Description copied from interface: Measure
      Divides this measure by a unit of electric current and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
      Specified by:
      per in interface Measure<ForceUnit>
      Parameters:
      divisorUnit - the unit to divide by.
      Returns:
      the division result
    • div

      public Force div(Dimensionless divisor)
      Description copied from interface: Measure
      Divides this measure by a dimensionless scalar and returns the result.
      Specified by:
      div in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • divide

      @Deprecated(since="2025", forRemoval=true) public Force divide(Dimensionless divisor)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use div instead. This was renamed for consistency with other languages like Kotlin
      Divides this measure by a dimensionless scalar and returns the result.
      Specified by:
      divide in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • times

      public Force times(Dimensionless multiplier)
      Description copied from interface: Measure
      Multiplies this measure by a scalar dimensionless multiplier.
      Specified by:
      times in interface Measure<ForceUnit>
      Parameters:
      multiplier - the scalar multiplication factor
      Returns:
      the scaled result
    • times

      public Energy times(Distance multiplier)
      Description copied from interface: Measure
      Multiplies this measure by a distance and returns the resulting measure in the most appropriate unit.
      Specified by:
      times in interface Measure<ForceUnit>
      Parameters:
      multiplier - the measurement to multiply by.
      Returns:
      the multiplication result
    • div

      public Per<ForceUnit,DistanceUnit> div(Distance divisor)
      Description copied from interface: Measure
      Divides this measure by a distance and returns the result in the most appropriate unit.
      Specified by:
      div in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • divide

      Deprecated, for removal: This API element is subject to removal in a future version.
      use div instead. This was renamed for consistency with other languages like Kotlin
      Divides this measure by a distance and returns the result in the most appropriate unit.
      Specified by:
      divide in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • per

      public Per<ForceUnit,DistanceUnit> per(DistanceUnit divisorUnit)
      Description copied from interface: Measure
      Divides this measure by a distance unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
      Specified by:
      per in interface Measure<ForceUnit>
      Parameters:
      divisorUnit - the unit to divide by.
      Returns:
      the division result
    • times

      public Mult<ForceUnit,EnergyUnit> times(Energy multiplier)
      Description copied from interface: Measure
      Multiplies this measure by an energy and returns the resulting measure in the most appropriate unit.
      Specified by:
      times in interface Measure<ForceUnit>
      Parameters:
      multiplier - the measurement to multiply by.
      Returns:
      the multiplication result
    • div

      public Per<ForceUnit,EnergyUnit> div(Energy divisor)
      Description copied from interface: Measure
      Divides this measure by an energy and returns the result in the most appropriate unit.
      Specified by:
      div in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • divide

      @Deprecated(since="2025", forRemoval=true) public Per<ForceUnit,EnergyUnit> divide(Energy divisor)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use div instead. This was renamed for consistency with other languages like Kotlin
      Divides this measure by an energy and returns the result in the most appropriate unit.
      Specified by:
      divide in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • per

      public Per<ForceUnit,EnergyUnit> per(EnergyUnit divisorUnit)
      Description copied from interface: Measure
      Divides this measure by an energy unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
      Specified by:
      per in interface Measure<ForceUnit>
      Parameters:
      divisorUnit - the unit to divide by.
      Returns:
      the division result
    • times

      public Mult<ForceUnit,ForceUnit> times(Force multiplier)
      Description copied from interface: Measure
      Multiplies this measure by a force and returns the resulting measure in the most appropriate unit.
      Specified by:
      times in interface Measure<ForceUnit>
      Parameters:
      multiplier - the measurement to multiply by.
      Returns:
      the multiplication result
    • div

      public Dimensionless div(Force divisor)
      Description copied from interface: Measure
      Divides this measure by a force and returns the result in the most appropriate unit.
      Specified by:
      div in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • divide

      @Deprecated(since="2025", forRemoval=true) public Dimensionless divide(Force divisor)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use div instead. This was renamed for consistency with other languages like Kotlin
      Divides this measure by a force and returns the result in the most appropriate unit.
      Specified by:
      divide in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • per

      public Dimensionless per(ForceUnit divisorUnit)
      Description copied from interface: Measure
      Divides this measure by a force unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
      Specified by:
      per in interface Measure<ForceUnit>
      Parameters:
      divisorUnit - the unit to divide by.
      Returns:
      the division result
    • times

      public Mult<ForceUnit,FrequencyUnit> times(Frequency multiplier)
      Description copied from interface: Measure
      Multiplies this measure by a frequency and returns the resulting measure in the most appropriate unit. This often - but not always - means implementations return a variation of a Per measure.
      Specified by:
      times in interface Measure<ForceUnit>
      Parameters:
      multiplier - the measurement to multiply by.
      Returns:
      the multiplication result
    • div

      Description copied from interface: Measure
      Divides this measure by a frequency and returns the result in the most appropriate unit.
      Specified by:
      div in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • divide

      Deprecated, for removal: This API element is subject to removal in a future version.
      use div instead. This was renamed for consistency with other languages like Kotlin
      Divides this measure by a frequency and returns the result in the most appropriate unit.
      Specified by:
      divide in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • per

      public Per<ForceUnit,FrequencyUnit> per(FrequencyUnit divisorUnit)
      Description copied from interface: Measure
      Divides this measure by a frequency unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
      Specified by:
      per in interface Measure<ForceUnit>
      Parameters:
      divisorUnit - the unit to divide by.
      Returns:
      the division result
    • times

      Description copied from interface: Measure
      Multiplies this measure by a linear acceleration and returns the resulting measure in the most appropriate unit.
      Specified by:
      times in interface Measure<ForceUnit>
      Parameters:
      multiplier - the measurement to multiply by.
      Returns:
      the multiplication result
    • div

      public Mass div(LinearAcceleration divisor)
      Description copied from interface: Measure
      Divides this measure by a linear acceleration and returns the result in the most appropriate unit.
      Specified by:
      div in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • divide

      @Deprecated(since="2025", forRemoval=true) public Mass divide(LinearAcceleration divisor)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use div instead. This was renamed for consistency with other languages like Kotlin
      Divides this measure by a linear acceleration and returns the result in the most appropriate unit.
      Specified by:
      divide in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • per

      public Mass per(LinearAccelerationUnit divisorUnit)
      Description copied from interface: Measure
      Divides this measure by a linear acceleration unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
      Specified by:
      per in interface Measure<ForceUnit>
      Parameters:
      divisorUnit - the unit to divide by.
      Returns:
      the division result
    • times

      Description copied from interface: Measure
      Multiplies this measure by a linear momentum and returns the resulting measure in the most appropriate unit.
      Specified by:
      times in interface Measure<ForceUnit>
      Parameters:
      multiplier - the measurement to multiply by.
      Returns:
      the multiplication result
    • div

      Description copied from interface: Measure
      Divides this measure by a linear momentum and returns the result in the most appropriate unit.
      Specified by:
      div in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • divide

      Deprecated, for removal: This API element is subject to removal in a future version.
      use div instead. This was renamed for consistency with other languages like Kotlin
      Divides this measure by a linear momentum and returns the result in the most appropriate unit.
      Specified by:
      divide in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • per

      Description copied from interface: Measure
      Divides this measure by a linear momentum unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
      Specified by:
      per in interface Measure<ForceUnit>
      Parameters:
      divisorUnit - the unit to divide by.
      Returns:
      the division result
    • times

      Description copied from interface: Measure
      Multiplies this measure by a linear velocity and returns the resulting measure in the most appropriate unit.
      Specified by:
      times in interface Measure<ForceUnit>
      Parameters:
      multiplier - the measurement to multiply by.
      Returns:
      the multiplication result
    • div

      Description copied from interface: Measure
      Divides this measure by a linear velocity and returns the result in the most appropriate unit.
      Specified by:
      div in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • divide

      Deprecated, for removal: This API element is subject to removal in a future version.
      use div instead. This was renamed for consistency with other languages like Kotlin
      Divides this measure by a linear velocity and returns the result in the most appropriate unit.
      Specified by:
      divide in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • per

      Description copied from interface: Measure
      Divides this measure by a linear velocity unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
      Specified by:
      per in interface Measure<ForceUnit>
      Parameters:
      divisorUnit - the unit to divide by.
      Returns:
      the division result
    • times

      public Mult<ForceUnit,MassUnit> times(Mass multiplier)
      Description copied from interface: Measure
      Multiplies this measure by a mass and returns the resulting measure in the most appropriate unit.
      Specified by:
      times in interface Measure<ForceUnit>
      Parameters:
      multiplier - the measurement to multiply by.
      Returns:
      the multiplication result
    • div

      public LinearAcceleration div(Mass divisor)
      Description copied from interface: Measure
      Divides this measure by a mass and returns the result in the most appropriate unit.
      Specified by:
      div in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • divide

      @Deprecated(since="2025", forRemoval=true) public LinearAcceleration divide(Mass divisor)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use div instead. This was renamed for consistency with other languages like Kotlin
      Divides this measure by a mass and returns the result in the most appropriate unit.
      Specified by:
      divide in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • per

      public LinearAcceleration per(MassUnit divisorUnit)
      Description copied from interface: Measure
      Divides this measure by a mass unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
      Specified by:
      per in interface Measure<ForceUnit>
      Parameters:
      divisorUnit - the unit to divide by.
      Returns:
      the division result
    • times

      Description copied from interface: Measure
      Multiplies this measure by a moment of intertia and returns the resulting measure in the most appropriate unit.
      Specified by:
      times in interface Measure<ForceUnit>
      Parameters:
      multiplier - the measurement to multiply by.
      Returns:
      the multiplication result
    • div

      Description copied from interface: Measure
      Divides this measure by a moment of inertia and returns the result in the most appropriate unit.
      Specified by:
      div in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • divide

      Deprecated, for removal: This API element is subject to removal in a future version.
      use div instead. This was renamed for consistency with other languages like Kotlin
      Divides this measure by a moment of inertia and returns the result in the most appropriate unit.
      Specified by:
      divide in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • per

      Description copied from interface: Measure
      Divides this measure by a moment of inertia unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
      Specified by:
      per in interface Measure<ForceUnit>
      Parameters:
      divisorUnit - the unit to divide by.
      Returns:
      the division result
    • times

      public Mult<ForceUnit,MultUnit<?,?>> times(Mult<?,?> multiplier)
      Description copied from interface: Measure
      Multiplies this measure by a generic multiplied measure and returns the resulting measure in the most appropriate unit.
      Specified by:
      times in interface Measure<ForceUnit>
      Parameters:
      multiplier - the measurement to multiply by.
      Returns:
      the multiplication result
    • div

      public Per<ForceUnit,MultUnit<?,?>> div(Mult<?,?> divisor)
      Description copied from interface: Measure
      Divides this measure by a generic multiplication and returns the result in the most appropriate unit.
      Specified by:
      div in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • divide

      @Deprecated(since="2025", forRemoval=true) public Per<ForceUnit,MultUnit<?,?>> divide(Mult<?,?> divisor)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use div instead. This was renamed for consistency with other languages like Kotlin
      Divides this measure by a generic multiplication and returns the result in the most appropriate unit.
      Specified by:
      divide in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • per

      public Per<ForceUnit,MultUnit<?,?>> per(MultUnit<?,?> divisorUnit)
      Description copied from interface: Measure
      Divides this measure by a generic compound unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
      Specified by:
      per in interface Measure<ForceUnit>
      Parameters:
      divisorUnit - the unit to divide by.
      Returns:
      the division result
    • times

      public Mult<ForceUnit,PerUnit<?,?>> times(Per<?,?> multiplier)
      Description copied from interface: Measure
      Multiplies this measure by a generic ratio measurement and returns the resulting measure in the most appropriate unit.
      Specified by:
      times in interface Measure<ForceUnit>
      Parameters:
      multiplier - the measurement to multiply by.
      Returns:
      the multiplication result
    • div

      public Per<ForceUnit,PerUnit<?,?>> div(Per<?,?> divisor)
      Description copied from interface: Measure
      Divides this measure by a generic ratio and returns the result in the most appropriate unit.
      Specified by:
      div in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • divide

      @Deprecated(since="2025", forRemoval=true) public Per<ForceUnit,PerUnit<?,?>> divide(Per<?,?> divisor)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use div instead. This was renamed for consistency with other languages like Kotlin
      Divides this measure by a generic ratio and returns the result in the most appropriate unit.
      Specified by:
      divide in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • per

      public Per<ForceUnit,PerUnit<?,?>> per(PerUnit<?,?> divisorUnit)
      Description copied from interface: Measure
      Divides this measure by a generic ratio unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
      Specified by:
      per in interface Measure<ForceUnit>
      Parameters:
      divisorUnit - the unit to divide by.
      Returns:
      the division result
    • times

      public Mult<ForceUnit,PowerUnit> times(Power multiplier)
      Description copied from interface: Measure
      Multiplies this measure by a power and returns the resulting measure in the most appropriate unit.
      Specified by:
      times in interface Measure<ForceUnit>
      Parameters:
      multiplier - the measurement to multiply by.
      Returns:
      the multiplication result
    • div

      public Per<ForceUnit,PowerUnit> div(Power divisor)
      Description copied from interface: Measure
      Divides this measure by a power and returns the result in the most appropriate unit.
      Specified by:
      div in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • divide

      @Deprecated(since="2025", forRemoval=true) public Per<ForceUnit,PowerUnit> divide(Power divisor)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use div instead. This was renamed for consistency with other languages like Kotlin
      Divides this measure by a power and returns the result in the most appropriate unit.
      Specified by:
      divide in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • per

      public Per<ForceUnit,PowerUnit> per(PowerUnit divisorUnit)
      Description copied from interface: Measure
      Divides this measure by a power unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
      Specified by:
      per in interface Measure<ForceUnit>
      Parameters:
      divisorUnit - the unit to divide by.
      Returns:
      the division result
    • times

      Description copied from interface: Measure
      Multiplies this measure by a resistance and returns the resulting measure in the most appropriate unit.
      Specified by:
      times in interface Measure<ForceUnit>
      Parameters:
      multiplier - the measurement to multiply by.
      Returns:
      the multiplication result
    • div

      Description copied from interface: Measure
      Divides this measure by a resistance and returns the result in the most appropriate unit.
      Specified by:
      div in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • divide

      Deprecated, for removal: This API element is subject to removal in a future version.
      use div instead. This was renamed for consistency with other languages like Kotlin
      Divides this measure by a resistance and returns the result in the most appropriate unit.
      Specified by:
      divide in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • per

      Description copied from interface: Measure
      Divides this measure by a resistance unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
      Specified by:
      per in interface Measure<ForceUnit>
      Parameters:
      divisorUnit - the unit to divide by.
      Returns:
      the division result
    • times

      Description copied from interface: Measure
      Multiplies this measure by a temperature and returns the resulting measure in the most appropriate unit.
      Specified by:
      times in interface Measure<ForceUnit>
      Parameters:
      multiplier - the measurement to multiply by.
      Returns:
      the multiplication result
    • div

      Description copied from interface: Measure
      Divides this measure by a temperature and returns the result in the most appropriate unit.
      Specified by:
      div in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • divide

      Deprecated, for removal: This API element is subject to removal in a future version.
      use div instead. This was renamed for consistency with other languages like Kotlin
      Divides this measure by a temperature and returns the result in the most appropriate unit.
      Specified by:
      divide in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • per

      Description copied from interface: Measure
      Divides this measure by a temperature unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
      Specified by:
      per in interface Measure<ForceUnit>
      Parameters:
      divisorUnit - the unit to divide by.
      Returns:
      the division result
    • times

      public Mult<ForceUnit,TimeUnit> times(Time multiplier)
      Description copied from interface: Measure
      Multiplies this measure by a time and returns the resulting measure in the most appropriate unit.
      Specified by:
      times in interface Measure<ForceUnit>
      Parameters:
      multiplier - the measurement to multiply by.
      Returns:
      the multiplication result
    • div

      public Velocity<ForceUnit> div(Time divisor)
      Description copied from interface: Measure
      Divides this measure by a time and returns the result in the most appropriate unit. This will often - but not always - result in a Per type like LinearVelocity or Acceleration.
      Specified by:
      div in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • divide

      @Deprecated(since="2025", forRemoval=true) public Velocity<ForceUnit> divide(Time divisor)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use div instead. This was renamed for consistency with other languages like Kotlin
      Divides this measure by a time and returns the result in the most appropriate unit. This will often - but not always - result in a Per type like LinearVelocity or Acceleration.
      Specified by:
      divide in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • per

      public Velocity<ForceUnit> per(TimeUnit divisorUnit)
      Description copied from interface: Measure
      Divides this measure by a time period and returns the result in the most appropriate unit. This is equivalent to div(period.of(1)).
      Specified by:
      per in interface Measure<ForceUnit>
      Parameters:
      divisorUnit - the time period measurement to divide by.
      Returns:
      the division result
    • times

      public Mult<ForceUnit,TorqueUnit> times(Torque multiplier)
      Description copied from interface: Measure
      Multiplies this measure by a torque and returns the resulting measure in the most appropriate unit.
      Specified by:
      times in interface Measure<ForceUnit>
      Parameters:
      multiplier - the measurement to multiply by.
      Returns:
      the multiplication result
    • div

      public Per<ForceUnit,TorqueUnit> div(Torque divisor)
      Description copied from interface: Measure
      Divides this measure by a torque and returns the result in the most appropriate unit.
      Specified by:
      div in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • divide

      @Deprecated(since="2025", forRemoval=true) public Per<ForceUnit,TorqueUnit> divide(Torque divisor)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use div instead. This was renamed for consistency with other languages like Kotlin
      Divides this measure by a torque and returns the result in the most appropriate unit.
      Specified by:
      divide in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • per

      public Per<ForceUnit,TorqueUnit> per(TorqueUnit divisorUnit)
      Description copied from interface: Measure
      Divides this measure by a torque unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
      Specified by:
      per in interface Measure<ForceUnit>
      Parameters:
      divisorUnit - the unit to divide by.
      Returns:
      the division result
    • times

      public Mult<ForceUnit,VelocityUnit<?>> times(Velocity<?> multiplier)
      Description copied from interface: Measure
      Multiplies this measure by a generic velocity and returns the resulting measure in the most appropriate unit.
      Specified by:
      times in interface Measure<ForceUnit>
      Parameters:
      multiplier - the measurement to multiply by.
      Returns:
      the multiplication result
    • div

      public Per<ForceUnit,VelocityUnit<?>> div(Velocity<?> divisor)
      Description copied from interface: Measure
      Divides this measure by a generic velocity and returns the result in the most appropriate unit.
      Specified by:
      div in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • divide

      @Deprecated(since="2025", forRemoval=true) public Per<ForceUnit,VelocityUnit<?>> divide(Velocity<?> divisor)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use div instead. This was renamed for consistency with other languages like Kotlin
      Divides this measure by a generic velocity and returns the result in the most appropriate unit.
      Specified by:
      divide in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • per

      public Per<ForceUnit,VelocityUnit<?>> per(VelocityUnit<?> divisorUnit)
      Description copied from interface: Measure
      Divides this measure by a velocity unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
      Specified by:
      per in interface Measure<ForceUnit>
      Parameters:
      divisorUnit - the unit to divide by.
      Returns:
      the division result
    • times

      public Mult<ForceUnit,VoltageUnit> times(Voltage multiplier)
      Description copied from interface: Measure
      Multiplies this measure by a voltage and returns the resulting measure in the most appropriate unit.
      Specified by:
      times in interface Measure<ForceUnit>
      Parameters:
      multiplier - the measurement to multiply by.
      Returns:
      the multiplication result
    • div

      public Per<ForceUnit,VoltageUnit> div(Voltage divisor)
      Description copied from interface: Measure
      Divides this measure by a voltage and returns the result in the most appropriate unit.
      Specified by:
      div in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • divide

      Deprecated, for removal: This API element is subject to removal in a future version.
      use div instead. This was renamed for consistency with other languages like Kotlin
      Divides this measure by a voltage and returns the result in the most appropriate unit.
      Specified by:
      divide in interface Measure<ForceUnit>
      Parameters:
      divisor - the measurement to divide by.
      Returns:
      the division result
    • per

      public Per<ForceUnit,VoltageUnit> per(VoltageUnit divisorUnit)
      Description copied from interface: Measure
      Divides this measure by a voltage unit and returns the result in the most appropriate unit. This is equivalent to div(divisorUnit.of(1)).
      Specified by:
      per in interface Measure<ForceUnit>
      Parameters:
      divisorUnit - the unit to divide by.
      Returns:
      the division result
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • magnitude

      public double magnitude()
      Returns the value of the magnitude record component.
      Specified by:
      magnitude in interface Measure<ForceUnit>
      Returns:
      the value of the magnitude record component
    • baseUnitMagnitude

      public double baseUnitMagnitude()
      Returns the value of the baseUnitMagnitude record component.
      Specified by:
      baseUnitMagnitude in interface Measure<ForceUnit>
      Returns:
      the value of the baseUnitMagnitude record component
    • unit

      public ForceUnit unit()
      Returns the value of the unit record component.
      Specified by:
      unit in interface Measure<ForceUnit>
      Returns:
      the value of the unit record component