Class ProjectileMotion

java.lang.Object
org.episteme.natural.physics.classical.mechanics.ProjectileMotion

public class ProjectileMotion extends Object
Projectile motion calculator with air resistance options.

Provides calculations for:

  • Maximum height
  • Range (horizontal distance)
  • Time of flight
  • Trajectory points

Uses proper types: Vector for position/velocity, Matrix for trajectories, Quantity for physical quantities, Real for dimensionless values.

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

    • ProjectileMotion

      public ProjectileMotion(Real initialSpeed, Real launchAngleDegrees, Real launchHeight)
      Creates projectile with specified parameters.
      Parameters:
      initialSpeed - initial velocity magnitude
      launchAngleDegrees - launch angle in degrees
      launchHeight - initial height above ground
    • ProjectileMotion

      public ProjectileMotion(Real initialSpeed, Real launchAngleDegrees, Real launchHeight, Real gravity)
      Creates projectile with custom gravity.
      Parameters:
      initialSpeed - initial velocity magnitude
      launchAngleDegrees - launch angle in degrees
      launchHeight - initial height above ground
      gravity - gravitational acceleration
  • Method Details

    • getMaxHeight

      public Quantity<Length> getMaxHeight()
      Calculates maximum height reached.
      Returns:
      maximum height as Length quantity
    • getRange

      public Quantity<Length> getRange()
      Calculates horizontal range (assuming flat ground at launch height).
      Returns:
      horizontal range as Length quantity
    • getTimeOfFlight

      public Quantity<Time> getTimeOfFlight()
      Calculates time of flight until ground.
      Returns:
      time of flight as Time quantity
    • getTimeOfFlightReal

      public Real getTimeOfFlightReal()
      Returns time of flight as Real value.
      Returns:
      time of flight in seconds
    • getPosition

      public Vector<Real> getPosition(Real t)
      Returns position at time t as a 2D Vector.
      Parameters:
      t - time elapsed
      Returns:
      Vector with [x, y] position
    • getVelocity

      public Vector<Real> getVelocity(Real t)
      Returns velocity at time t as a 2D Vector.
      Parameters:
      t - time elapsed
      Returns:
      Vector with [vx, vy] velocity
    • optimalAngle

      public static Real optimalAngle()
      Calculates optimal launch angle for maximum range (45°).
      Returns:
      optimal angle in degrees
    • optimalAngle

      public static Real optimalAngle(Real launchHeight, Real range, Real initialSpeed)
      Calculates optimal angle considering launch height above target.
      Parameters:
      launchHeight - height difference
      range - target range
      initialSpeed - projectile speed
      Returns:
      optimal angle in degrees
    • getTrajectory

      public Matrix<Real> getTrajectory(int numPoints)
      Generates trajectory points as a Matrix.

      Each row represents a point: [x, y]

      Parameters:
      numPoints - number of trajectory points
      Returns:
      Matrix with trajectory data (numPoints x 2)
    • getInitialVelocity

      public Vector<Real> getInitialVelocity()
      Returns initial velocity components as a Vector.
      Returns:
      Vector with [vx0, vy0]
    • getInitialSpeed

      public Real getInitialSpeed()
      Returns the initial speed.
    • getLaunchAngle

      public Real getLaunchAngle()
      Returns the launch angle in radians.
    • getLaunchHeight

      public Real getLaunchHeight()
      Returns the launch height.
    • toString

      public String toString()
      Overrides:
      toString in class Object