Class ProjectileMotion
java.lang.Object
org.episteme.natural.physics.classical.mechanics.ProjectileMotion
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 Summary
ConstructorsConstructorDescriptionProjectileMotion(Real initialSpeed, Real launchAngleDegrees, Real launchHeight) Creates projectile with specified parameters.ProjectileMotion(Real initialSpeed, Real launchAngleDegrees, Real launchHeight, Real gravity) Creates projectile with custom gravity. -
Method Summary
Modifier and TypeMethodDescriptionReturns the initial speed.Returns initial velocity components as a Vector.Returns the launch angle in radians.Returns the launch height.Calculates maximum height reached.getPosition(Real t) Returns position at time t as a 2D Vector.getRange()Calculates horizontal range (assuming flat ground at launch height).Calculates time of flight until ground.Returns time of flight as Real value.getTrajectory(int numPoints) Generates trajectory points as a Matrix.getVelocity(Real t) Returns velocity at time t as a 2D Vector.static RealCalculates optimal launch angle for maximum range (45°).static RealoptimalAngle(Real launchHeight, Real range, Real initialSpeed) Calculates optimal angle considering launch height above target.toString()
-
Constructor Details
-
ProjectileMotion
-
ProjectileMotion
public ProjectileMotion(Real initialSpeed, Real launchAngleDegrees, Real launchHeight, Real gravity) Creates projectile with custom gravity.- Parameters:
initialSpeed- initial velocity magnitudelaunchAngleDegrees- launch angle in degreeslaunchHeight- initial height above groundgravity- gravitational acceleration
-
-
Method Details
-
getMaxHeight
-
getRange
-
getTimeOfFlight
-
getTimeOfFlightReal
Returns time of flight as Real value.- Returns:
- time of flight in seconds
-
getPosition
-
getVelocity
-
optimalAngle
Calculates optimal launch angle for maximum range (45°).- Returns:
- optimal angle in degrees
-
optimalAngle
-
getTrajectory
-
getInitialVelocity
-
getInitialSpeed
Returns the initial speed. -
getLaunchAngle
Returns the launch angle in radians. -
getLaunchHeight
Returns the launch height. -
toString
-