Class PhysicsUtil

java.lang.Object
com.flarerobotics.lib.math.PhysicsUtil

public class PhysicsUtil extends Object
A physics utility class.
  • Field Details

    • kG

      public static double kG
      The graviational acceleration of the earth in m/s^2.
  • Method Details

    • computeAirDensity

      public static double computeAirDensity(double temp, double alt, double rel)
      Computes the air density.

      Note: Air density can be calculated via:

      S = 611.21 * exp(17.502 * T / (240.97 + T)) Rho_air = (101325 * (1 - 0.0065 * Y / 288.15)^5.255877 - H * S) / (287.05 * (T + 273.15)) + H * S / (461.5 * (T + 273.15))

      where T is the temperature in Celsius, Y is the altitude in meters, and H is the relative humidity in range [0, 1].

      Parameters:
      temp - The temperature, in Celsius.
      alt - The altitude, in meters.
      rel - The relative humidity, in the range [0, 100]%.
      Returns:
      The air density, in kg/m^3.