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

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

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

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

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

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

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

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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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

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

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


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

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

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


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

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

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


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

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

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


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

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

  @Override
  public LinearVelocity per(FrequencyUnit divisorUnit) {
    return div(divisorUnit.one());
  }


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

  @Override
  public Velocity<LinearAccelerationUnit> div(Time divisor) {
    return VelocityUnit.combine(unit(), divisor.unit()).ofBaseUnits(baseUnitMagnitude() / divisor.baseUnitMagnitude());
  }

  @Override
  public Velocity<LinearAccelerationUnit> per(TimeUnit divisorUnit) {
    return div(divisorUnit.one());
  }


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

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

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


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

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

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


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

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

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

}
