Class BallAerodynamics

java.lang.Object
org.episteme.social.sports.BallAerodynamics

public final class BallAerodynamics extends Object
Models the aerodynamics of a spherical ball in flight, including Drag and Magnus effects. Modernized to use Quantity and Real for high-precision physical simulations.
Since:
1.0
Version:
1.2
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Method Details

    • calculateMagnusForce

      public static Quantity<Force> calculateMagnusForce(Quantity<MassDensity> rho, Quantity<Length> radius, Quantity<Velocity> velocity, Quantity<Frequency> spin)
      Calculates the Magnus Force (lift/swerve) on a spinning ball. Formula: Fm = 0.5 * Cl * rho * A * (r * omega) * v
      Parameters:
      rho - Air density
      radius - Ball radius
      velocity - Ball velocity
      spin - Spin rate (frequency)
      Returns:
      The Magnus force
    • calculateDragForce

      public static Quantity<Force> calculateDragForce(Quantity<MassDensity> rho, Quantity<Length> radius, Quantity<Velocity> velocity, Real cd)
      Calculates the Aerodynamic Drag Force. Formula: Fd = 0.5 * Cd * rho * A * v^2
      Parameters:
      rho - Air density
      radius - Ball radius
      velocity - Ball velocity
      cd - Drag Coefficient (dimensionless)
      Returns:
      The Drag force
    • projectImpact

      public static Quantity<?>[] projectImpact(Quantity<Length>[] pos, Quantity<Velocity>[] vel, Quantity<Frequency> spin, Quantity<Time> dt)
      Projects the impact point of a ball over a short time step `dt`.
      Parameters:
      pos - Current position [x, y]
      vel - Current velocity [vx, vy]
      spin - Spin rate
      dt - Time step
      Returns:
      A 4-element array: [newX, newY, newVx, newVy]