// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.

// THIS FILE WAS AUTO-GENERATED BY ./wpiunits/generate_units.py. DO NOT MODIFY

package org.wpilib.units.measure;

import static org.wpilib.units.Units.*;
import org.wpilib.units.*;

@SuppressWarnings({"unchecked", "cast", "checkstyle"})
public record AngularVelocity(double magnitude, double baseUnitMagnitude, AngularVelocityUnit unit) implements Measure<AngularVelocityUnit> {
  /**
   * For doing math with measures of a known dimension but an unknown unit. Most users should use
   * {@link AngularVelocityUnit#of(double)} on a known unit from {@link Units} instead of calling this method.
   * @param magnitude the magnitude of the measurement in terms of the given unit
   * @param unit the unit of the measurement
   * @return a measurement object
   */
  public static  AngularVelocity ofRelativeUnits(double magnitude, AngularVelocityUnit unit) {
    return new AngularVelocity(magnitude, unit.toBaseUnits(magnitude), unit);
  }

  /**
   * For doing math with measures of a known dimension but an unknown unit. Most users should use
   * {@link AngularVelocityUnit#of(double)} on a known unit from {@link Units} instead of calling this method.
   * @param baseUnitMagnitude the magnitude of the measurement in terms of the given unit's base unit
   * @param unit the unit of the measurement
   * @return a measurement object
   */
  public static  AngularVelocity ofBaseUnits(double baseUnitMagnitude, AngularVelocityUnit unit) {
    return new AngularVelocity(unit.fromBaseUnits(baseUnitMagnitude), baseUnitMagnitude, unit);
  }

  @Override
  public AngularVelocityUnit baseUnit() { return (AngularVelocityUnit) unit().getBaseUnit(); }

  @Override
  public double in(AngularVelocityUnit unit) {
    return unit.fromBaseUnits(baseUnitMagnitude());
  }

  @Override
  @SuppressWarnings("rawtypes")
  public boolean equals(Object object) {
    return object instanceof AngularVelocity m && isEquivalent(m);
  }

  @Override
  public AngularVelocity unaryMinus() {
    return (AngularVelocity) unit().ofBaseUnits(0 - baseUnitMagnitude());
  }

  @Override
  public AngularVelocity plus(Measure<? extends AngularVelocityUnit> other) {
    return (AngularVelocity) unit().ofBaseUnits(baseUnitMagnitude() + other.baseUnitMagnitude());
  }

  @Override
  public AngularVelocity minus(Measure<? extends AngularVelocityUnit> other) {
    return (AngularVelocity) unit().ofBaseUnits(baseUnitMagnitude() - other.baseUnitMagnitude());
  }

  @Override
  public AngularVelocity times(double multiplier) {
    return (AngularVelocity) unit().ofBaseUnits(baseUnitMagnitude() * multiplier);
  }

  @Override
  public AngularVelocity div(double divisor) {
    return (AngularVelocity) unit().ofBaseUnits(baseUnitMagnitude() / divisor);
  }


  @Override
  public Mult<AngularVelocityUnit, AccelerationUnit<?>> times(Acceleration<?> multiplier) {
    return (Mult<AngularVelocityUnit, AccelerationUnit<?>>) Measure.super.times(multiplier);
  }

  @Override
  public Per<AngularVelocityUnit, AccelerationUnit<?>> div(Acceleration<?> divisor) {
    return (Per<AngularVelocityUnit, AccelerationUnit<?>>) Measure.super.div(divisor);
  }

  @Override
  public Per<AngularVelocityUnit, AccelerationUnit<?>> per(AccelerationUnit<?> divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<AngularVelocityUnit, AngleUnit> times(Angle multiplier) {
    return (Mult<AngularVelocityUnit, AngleUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Per<AngularVelocityUnit, AngleUnit> div(Angle divisor) {
    return (Per<AngularVelocityUnit, AngleUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<AngularVelocityUnit, AngleUnit> per(AngleUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<AngularVelocityUnit, AngularAccelerationUnit> times(AngularAcceleration multiplier) {
    return (Mult<AngularVelocityUnit, AngularAccelerationUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Per<AngularVelocityUnit, AngularAccelerationUnit> div(AngularAcceleration divisor) {
    return (Per<AngularVelocityUnit, AngularAccelerationUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<AngularVelocityUnit, AngularAccelerationUnit> per(AngularAccelerationUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<AngularVelocityUnit, AngularMomentumUnit> times(AngularMomentum multiplier) {
    return (Mult<AngularVelocityUnit, AngularMomentumUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Per<AngularVelocityUnit, AngularMomentumUnit> div(AngularMomentum divisor) {
    return (Per<AngularVelocityUnit, AngularMomentumUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<AngularVelocityUnit, AngularMomentumUnit> per(AngularMomentumUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<AngularVelocityUnit, AngularVelocityUnit> times(AngularVelocity multiplier) {
    return (Mult<AngularVelocityUnit, AngularVelocityUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Dimensionless div(AngularVelocity divisor) {
    return Value.of(baseUnitMagnitude() / divisor.baseUnitMagnitude());
  }

  @Override
  public Dimensionless per(AngularVelocityUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<AngularVelocityUnit, CurrentUnit> times(Current multiplier) {
    return (Mult<AngularVelocityUnit, CurrentUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Per<AngularVelocityUnit, CurrentUnit> div(Current divisor) {
    return (Per<AngularVelocityUnit, CurrentUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<AngularVelocityUnit, CurrentUnit> per(CurrentUnit divisorUnit) {
    return div(divisorUnit.one());
  }

  @Override
  public AngularVelocity div(Dimensionless divisor) {
    return (AngularVelocity) RadiansPerSecond.of(baseUnitMagnitude() / divisor.baseUnitMagnitude());
  }

  @Override
  public AngularVelocity times(Dimensionless multiplier) {
    return (AngularVelocity) RadiansPerSecond.of(baseUnitMagnitude() * multiplier.baseUnitMagnitude());
  }


  @Override
  public Mult<AngularVelocityUnit, DistanceUnit> times(Distance multiplier) {
    return (Mult<AngularVelocityUnit, DistanceUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Per<AngularVelocityUnit, DistanceUnit> div(Distance divisor) {
    return (Per<AngularVelocityUnit, DistanceUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<AngularVelocityUnit, DistanceUnit> per(DistanceUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<AngularVelocityUnit, EnergyUnit> times(Energy multiplier) {
    return (Mult<AngularVelocityUnit, EnergyUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Per<AngularVelocityUnit, EnergyUnit> div(Energy divisor) {
    return (Per<AngularVelocityUnit, EnergyUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<AngularVelocityUnit, EnergyUnit> per(EnergyUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<AngularVelocityUnit, ForceUnit> times(Force multiplier) {
    return (Mult<AngularVelocityUnit, ForceUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Per<AngularVelocityUnit, ForceUnit> div(Force divisor) {
    return (Per<AngularVelocityUnit, ForceUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<AngularVelocityUnit, ForceUnit> per(ForceUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public AngularAcceleration times(Frequency multiplier) {
    return RadiansPerSecondPerSecond.of(baseUnitMagnitude() * multiplier.baseUnitMagnitude());
  }

  @Override
  public Per<AngularVelocityUnit, FrequencyUnit> div(Frequency divisor) {
    return (Per<AngularVelocityUnit, FrequencyUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<AngularVelocityUnit, FrequencyUnit> per(FrequencyUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<AngularVelocityUnit, LinearAccelerationUnit> times(LinearAcceleration multiplier) {
    return (Mult<AngularVelocityUnit, LinearAccelerationUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Per<AngularVelocityUnit, LinearAccelerationUnit> div(LinearAcceleration divisor) {
    return (Per<AngularVelocityUnit, LinearAccelerationUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<AngularVelocityUnit, LinearAccelerationUnit> per(LinearAccelerationUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<AngularVelocityUnit, LinearMomentumUnit> times(LinearMomentum multiplier) {
    return (Mult<AngularVelocityUnit, LinearMomentumUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Per<AngularVelocityUnit, LinearMomentumUnit> div(LinearMomentum divisor) {
    return (Per<AngularVelocityUnit, LinearMomentumUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<AngularVelocityUnit, LinearMomentumUnit> per(LinearMomentumUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<AngularVelocityUnit, LinearVelocityUnit> times(LinearVelocity multiplier) {
    return (Mult<AngularVelocityUnit, LinearVelocityUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Per<AngularVelocityUnit, LinearVelocityUnit> div(LinearVelocity divisor) {
    return (Per<AngularVelocityUnit, LinearVelocityUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<AngularVelocityUnit, LinearVelocityUnit> per(LinearVelocityUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<AngularVelocityUnit, MassUnit> times(Mass multiplier) {
    return (Mult<AngularVelocityUnit, MassUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Per<AngularVelocityUnit, MassUnit> div(Mass divisor) {
    return (Per<AngularVelocityUnit, MassUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<AngularVelocityUnit, MassUnit> per(MassUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<AngularVelocityUnit, MomentOfInertiaUnit> times(MomentOfInertia multiplier) {
    return (Mult<AngularVelocityUnit, MomentOfInertiaUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Per<AngularVelocityUnit, MomentOfInertiaUnit> div(MomentOfInertia divisor) {
    return (Per<AngularVelocityUnit, MomentOfInertiaUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<AngularVelocityUnit, MomentOfInertiaUnit> per(MomentOfInertiaUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<AngularVelocityUnit, MultUnit<?, ?>> times(Mult<?, ?> multiplier) {
    return (Mult<AngularVelocityUnit, MultUnit<?, ?>>) Measure.super.times(multiplier);
  }

  @Override
  public Per<AngularVelocityUnit, MultUnit<?, ?>> div(Mult<?, ?> divisor) {
    return (Per<AngularVelocityUnit, MultUnit<?, ?>>) Measure.super.div(divisor);
  }

  @Override
  public Per<AngularVelocityUnit, MultUnit<?, ?>> per(MultUnit<?, ?> divisorUnit) {
    return div(divisorUnit.ofNative(1));
  }


  @Override
  public Mult<AngularVelocityUnit, PerUnit<?, ?>> times(Per<?, ?> multiplier) {
    return (Mult<AngularVelocityUnit, PerUnit<?, ?>>) Measure.super.times(multiplier);
  }

  @Override
  public Per<AngularVelocityUnit, PerUnit<?, ?>> div(Per<?, ?> divisor) {
    return (Per<AngularVelocityUnit, PerUnit<?, ?>>) Measure.super.div(divisor);
  }

  @Override
  public Per<AngularVelocityUnit, PerUnit<?, ?>> per(PerUnit<?, ?> divisorUnit) {
    return div(divisorUnit.ofNative(1));
  }


  @Override
  public Mult<AngularVelocityUnit, PowerUnit> times(Power multiplier) {
    return (Mult<AngularVelocityUnit, PowerUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Per<AngularVelocityUnit, PowerUnit> div(Power divisor) {
    return (Per<AngularVelocityUnit, PowerUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<AngularVelocityUnit, PowerUnit> per(PowerUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<AngularVelocityUnit, ResistanceUnit> times(Resistance multiplier) {
    return (Mult<AngularVelocityUnit, ResistanceUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Per<AngularVelocityUnit, ResistanceUnit> div(Resistance divisor) {
    return (Per<AngularVelocityUnit, ResistanceUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<AngularVelocityUnit, ResistanceUnit> per(ResistanceUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<AngularVelocityUnit, TemperatureUnit> times(Temperature multiplier) {
    return (Mult<AngularVelocityUnit, TemperatureUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Per<AngularVelocityUnit, TemperatureUnit> div(Temperature divisor) {
    return (Per<AngularVelocityUnit, TemperatureUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<AngularVelocityUnit, TemperatureUnit> per(TemperatureUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Angle times(Time multiplier) {
    return Radians.of(baseUnitMagnitude() * multiplier.baseUnitMagnitude());
  }

  @Override
  public AngularAcceleration div(Time divisor) {
    return RadiansPerSecondPerSecond.of(baseUnitMagnitude() / divisor.baseUnitMagnitude());
  }

  @Override
  public AngularAcceleration per(TimeUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<AngularVelocityUnit, TorqueUnit> times(Torque multiplier) {
    return (Mult<AngularVelocityUnit, TorqueUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Per<AngularVelocityUnit, TorqueUnit> div(Torque divisor) {
    return (Per<AngularVelocityUnit, TorqueUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<AngularVelocityUnit, TorqueUnit> per(TorqueUnit divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<AngularVelocityUnit, VelocityUnit<?>> times(Velocity<?> multiplier) {
    return (Mult<AngularVelocityUnit, VelocityUnit<?>>) Measure.super.times(multiplier);
  }

  @Override
  public Per<AngularVelocityUnit, VelocityUnit<?>> div(Velocity<?> divisor) {
    return (Per<AngularVelocityUnit, VelocityUnit<?>>) Measure.super.div(divisor);
  }

  @Override
  public Per<AngularVelocityUnit, VelocityUnit<?>> per(VelocityUnit<?> divisorUnit) {
    return div(divisorUnit.one());
  }


  @Override
  public Mult<AngularVelocityUnit, VoltageUnit> times(Voltage multiplier) {
    return (Mult<AngularVelocityUnit, VoltageUnit>) Measure.super.times(multiplier);
  }

  @Override
  public Per<AngularVelocityUnit, VoltageUnit> div(Voltage divisor) {
    return (Per<AngularVelocityUnit, VoltageUnit>) Measure.super.div(divisor);
  }

  @Override
  public Per<AngularVelocityUnit, VoltageUnit> per(VoltageUnit divisorUnit) {
    return div(divisorUnit.one());
  }
public Frequency asFrequency() { return Hertz.of(baseUnitMagnitude()); }
}
