Class BallAerodynamics
java.lang.Object
org.episteme.social.sports.BallAerodynamics
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 Summary
Modifier and TypeMethodDescriptioncalculateDragForce(Quantity<MassDensity> rho, Quantity<Length> radius, Quantity<Velocity> velocity, Real cd) Calculates the Aerodynamic Drag Force.calculateMagnusForce(Quantity<MassDensity> rho, Quantity<Length> radius, Quantity<Velocity> velocity, Quantity<Frequency> spin) Calculates the Magnus Force (lift/swerve) on a spinning ball.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`.
-
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 densityradius- Ball radiusvelocity- Ball velocityspin- 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 densityradius- Ball radiusvelocity- Ball velocitycd- 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 ratedt- Time step- Returns:
- A 4-element array: [newX, newY, newVx, newVy]
-