Interface Dimension


public interface Dimension
Represents the physical dimension of a quantity.

A dimension is defined by the exponents of the seven SI base dimensions: Length (L), Mass (M), Time (T), Electric Current (I), Temperature (Θ), Amount of Substance (N), and Luminous Intensity (J).

Dimensions enable dimensional analysis - checking that equations are dimensionally consistent. For example:

Force = Mass × Acceleration
[F] = [M] × [L][T]⁻²
[F] = [M¹L¹T⁻²]

Example Usage:

Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Field Details

    • NONE

      static final Dimension NONE
      Dimensionless (no dimension) - all exponents are zero.
    • DIMENSIONLESS

      static final Dimension DIMENSIONLESS
      Dimensionless (alias for NONE).
    • LENGTH

      static final Dimension LENGTH
      Length dimension [L].
    • MASS

      static final Dimension MASS
      Mass dimension [M].
    • TIME

      static final Dimension TIME
      Time dimension [T].
    • ELECTRIC_CURRENT

      static final Dimension ELECTRIC_CURRENT
      Electric current dimension [I].
    • TEMPERATURE

      static final Dimension TEMPERATURE
      Temperature dimension [Θ].
    • AMOUNT_OF_SUBSTANCE

      static final Dimension AMOUNT_OF_SUBSTANCE
      Amount of substance dimension [N].
    • LUMINOUS_INTENSITY

      static final Dimension LUMINOUS_INTENSITY
      Luminous intensity dimension [J].
  • Method Details

    • getLengthExponent

      int getLengthExponent()
      Returns the length exponent (L).
      Returns:
      the length exponent
    • getMassExponent

      int getMassExponent()
      Returns the mass exponent (M).
      Returns:
      the mass exponent
    • getTimeExponent

      int getTimeExponent()
      Returns the time exponent (T).
      Returns:
      the time exponent
    • getElectricCurrentExponent

      int getElectricCurrentExponent()
      Returns the electric current exponent (I).
      Returns:
      the electric current exponent
    • getTemperatureExponent

      int getTemperatureExponent()
      Returns the temperature exponent (Θ).
      Returns:
      the temperature exponent
    • getAmountOfSubstanceExponent

      int getAmountOfSubstanceExponent()
      Returns the amount of substance exponent (N).
      Returns:
      the amount of substance exponent
    • getLuminousIntensityExponent

      int getLuminousIntensityExponent()
      Returns the luminous intensity exponent (J).
      Returns:
      the luminous intensity exponent
    • multiply

      Dimension multiply(Dimension other)
      Returns the product of this dimension with another.

      Multiplying dimensions adds their exponents.

      Parameters:
      other - the dimension to multiply with
      Returns:
      the product dimension
    • divide

      Dimension divide(Dimension other)
      Returns the quotient of this dimension by another.

      Dividing dimensions subtracts their exponents.

      Parameters:
      other - the dimension to divide by
      Returns:
      the quotient dimension
    • pow

      Dimension pow(int exponent)
      Returns this dimension raised to the specified power.

      Raising to a power multiplies all exponents by the power.

      Parameters:
      exponent - the exponent
      Returns:
      the dimension raised to the power
    • sqrt

      Dimension sqrt()
      Returns the square root of this dimension.

      All exponents must be even for the square root to be defined.

      Returns:
      the square root dimension
      Throws:
      IllegalArgumentException - if any exponent is odd
    • isDimensionless

      default boolean isDimensionless()
      Checks if this is a dimensionless quantity.
      Returns:
      true if all exponents are zero
    • of

      static Dimension of(int length, int mass, int time, int electricCurrent, int temperature, int amountOfSubstance, int luminousIntensity)
      Creates a dimension with the specified exponents.
      Parameters:
      length - length exponent (L)
      mass - mass exponent (M)
      time - time exponent (T)
      electricCurrent - electric current exponent (I)
      temperature - temperature exponent (Θ)
      amountOfSubstance - amount of substance exponent (N)
      luminousIntensity - luminous intensity exponent (J)
      Returns:
      the dimension