// 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 Dimensionless(double magnitude, double baseUnitMagnitude, DimensionlessUnit unit) implements Measure<DimensionlessUnit> {
  /**
   * For doing math with measures of a known dimension but an unknown unit. Most users should use
   * {@link DimensionlessUnit#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  Dimensionless ofRelativeUnits(double magnitude, DimensionlessUnit unit) {
    return new Dimensionless(magnitude, unit.toBaseUnits(magnitude), unit);
  }

  /**
   * For doing math with measures of a known dimension but an unknown unit. Most users should use
   * {@link DimensionlessUnit#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  Dimensionless ofBaseUnits(double baseUnitMagnitude, DimensionlessUnit unit) {
    return new Dimensionless(unit.fromBaseUnits(baseUnitMagnitude), baseUnitMagnitude, unit);
  }

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

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

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

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

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

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

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

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


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

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

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


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

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

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


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

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

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


  @Override
  public AngularMomentum times(AngularMomentum multiplier) {
    return KilogramMetersSquaredPerSecond.of(baseUnitMagnitude() * multiplier.baseUnitMagnitude());
  }

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

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


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

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

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


  @Override
  public Current times(Current multiplier) {
    return Amps.of(baseUnitMagnitude() * multiplier.baseUnitMagnitude());
  }

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

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

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

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


  @Override
  public Distance times(Distance multiplier) {
    return Meters.of(baseUnitMagnitude() * multiplier.baseUnitMagnitude());
  }

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

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


  @Override
  public Energy times(Energy multiplier) {
    return Joules.of(baseUnitMagnitude() * multiplier.baseUnitMagnitude());
  }

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

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


  @Override
  public Force times(Force multiplier) {
    return Newtons.of(baseUnitMagnitude() * multiplier.baseUnitMagnitude());
  }

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

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


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

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

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


  @Override
  public LinearAcceleration times(LinearAcceleration multiplier) {
    return MetersPerSecondPerSecond.of(baseUnitMagnitude() * multiplier.baseUnitMagnitude());
  }

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

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


  @Override
  public LinearMomentum times(LinearMomentum multiplier) {
    return KilogramMetersPerSecond.of(baseUnitMagnitude() * multiplier.baseUnitMagnitude());
  }

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

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


  @Override
  public LinearVelocity times(LinearVelocity multiplier) {
    return MetersPerSecond.of(baseUnitMagnitude() * multiplier.baseUnitMagnitude());
  }

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

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


  @Override
  public Mass times(Mass multiplier) {
    return Kilograms.of(baseUnitMagnitude() * multiplier.baseUnitMagnitude());
  }

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

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


  @Override
  public MomentOfInertia times(MomentOfInertia multiplier) {
    return KilogramSquareMeters.of(baseUnitMagnitude() * multiplier.baseUnitMagnitude());
  }

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

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


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

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

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


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

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

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


  @Override
  public Power times(Power multiplier) {
    return Watts.of(baseUnitMagnitude() * multiplier.baseUnitMagnitude());
  }

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

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


  @Override
  public Resistance times(Resistance multiplier) {
    return Ohms.of(baseUnitMagnitude() * multiplier.baseUnitMagnitude());
  }

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

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


  @Override
  public Temperature times(Temperature multiplier) {
    return Kelvin.of(baseUnitMagnitude() * multiplier.baseUnitMagnitude());
  }

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

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


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

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

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


  @Override
  public Torque times(Torque multiplier) {
    return NewtonMeters.of(baseUnitMagnitude() * multiplier.baseUnitMagnitude());
  }

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

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


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

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

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


  @Override
  public Voltage times(Voltage multiplier) {
    return Volts.of(baseUnitMagnitude() * multiplier.baseUnitMagnitude());
  }

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

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

}
