Interface PhysicsEngine
-
- All Known Implementing Classes:
JavaPhysicsEngine
public interface PhysicsEngineSome physic utility functions implementing in Java.Definitions:
- Since:
- 13.0
- Version:
- 17.0 2020-01-04 14:41:49
- Author:
- Christophe BOHRHAUER
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- mathphysics
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description doubleacceleration(double previousSpeed, double currentSpeed, double dt)Replies the new acceleration according to a previous speed and a current speed, and given time.doublemotionNewtonEuler1Law(double speed, double dt)Compute and replies a motion according to Newton-Euler-1 equations for motion (where acceleration is not significant).doublemotionNewtonEuler1Law1D(double velocity, double minSpeed, double maxSpeed, double dt)Compute and replies a motion according to Newton-Euler-1 equations for motion (where acceleration is not significant).voidmotionNewtonEuler1Law1D5(Vector1D<?,?,?> velocity, double minSpeed, double maxSpeed, double dt, Vector1D<?,?,?> result)Compute and replies a motion according to Newton-Euler-1 equations for motion (where acceleration is not significant).voidmotionNewtonEuler1Law1D5(Vector2D<?,?> velocity, double minSpeed, double maxSpeed, double dt, Vector2D<?,?> result)Deprecated, for removal: This API element is subject to removal in a future version.voidmotionNewtonEuler1Law2D(Vector2D<?,?> velocity, double minSpeed, double maxSpeed, double dt, Vector2D<?,?> result)Compute and replies a motion according to Newton-Euler-1 equations for motion (where acceleration is not significant).voidmotionNewtonEuler1Law2D5(Vector3D<?,?> velocity, double minSpeed, double maxSpeed, double dt, Vector3D<?,?> result)Compute and replies a motion according to Newton-Euler-1 equations for motion (where acceleration is not significant).voidmotionNewtonEuler1Law3D(Vector3D<?,?> velocity, double minSpeed, double maxSpeed, double dt, Vector3D<?,?> result)Compute and replies a motion according to Newton-Euler-1 equations for motion (where acceleration is not significant).doublemotionNewtonLaw(double speed, double acceleration, double dt)Compute and replies a motion according to high school physics Newton's equations for motion.doublemotionNewtonLaw1D(double velocity, double minSpeed, double maxSpeed, double acceleration, double minAcceleration, double maxAcceleration, double dt)Compute and replies a motion according to high school physics Newton's equations for motion.voidmotionNewtonLaw1D5(Vector1D<?,?,?> velocity, double minSpeed, double maxSpeed, Vector1D<?,?,?> acceleration, double minAcceleration, double maxAcceleration, double dt, Vector1D<?,?,?> result)Compute and replies a motion according to high school physics Newton's equations for motion.voidmotionNewtonLaw1D5(Vector2D<?,?> velocity, double minSpeed, double maxSpeed, Vector2D<?,?> acceleration, double minAcceleration, double maxAcceleration, double dt, Vector2D<?,?> result)Deprecated, for removal: This API element is subject to removal in a future version.voidmotionNewtonLaw2D(Vector2D<?,?> velocity, double minSpeed, double maxSpeed, Vector2D<?,?> acceleration, double minAcceleration, double maxAcceleration, double dt, Vector2D<?,?> result)Compute and replies a motion according to high school physics Newton's equations for motion.voidmotionNewtonLaw2D5(Vector3D<?,?> velocity, double minSpeed, double maxSpeed, Vector3D<?,?> acceleration, double minAcceleration, double maxAcceleration, double dt, Vector3D<?,?> result)Compute and replies a motion according to high school physics Newton's equations for motion.voidmotionNewtonLaw3D(Vector3D<?,?> velocity, double minSpeed, double maxSpeed, Vector3D<?,?> acceleration, double minAcceleration, double maxAcceleration, double dt, Vector3D<?,?> result)Compute and replies a motion according to high school physics Newton's equations for motion.doublespeed(double movement, double dt)Replies the new speed according to a previous speed and a mouvement during a given time.
-
-
-
Method Detail
-
motionNewtonLaw
@Pure double motionNewtonLaw(double speed, double acceleration, double dt)Compute and replies a motion according to high school physics Newton's equations for motion.From Equation 2 of the SUVAT form:
movement = speed * dt + 0.5 * acceleration * dt * dt- Parameters:
speed- is the current speed of the object.acceleration- is the current acceleration of the object.dt- is the time- Returns:
- a motion
-
motionNewtonLaw1D
@Pure double motionNewtonLaw1D(double velocity, double minSpeed, double maxSpeed, double acceleration, double minAcceleration, double maxAcceleration, double dt)Compute and replies a motion according to high school physics Newton's equations for motion.This function allows to clamp acceleration and velocity.
From Equation 2 of the SUVAT form:
clamped_acceleration = clamp(acceleration, minAcceleration, maxAcceleration)
new_velocity = velocity + 0.5 * clamped_acceleration * dt
clamped_velocity = clamp(new_velocity, minSpeed, maxSpeed)
motion = clamped_velocity * dt- Parameters:
velocity- is the current velocity of the object.minSpeed- is the minimal speed allowed.maxSpeed- is the maximal speed allowed.acceleration- is the current acceleration of the object.minAcceleration- is the minimal acceleration allowed.maxAcceleration- is the maximal acceleration allowed. Length of this vector is the acceleration amount. Direction of this vector becomes movement direction.dt- is the time.- Returns:
- the motion
- See Also:
- "http://en.wikibooks.org/wiki/High_School_Physics/Velocity"
-
motionNewtonLaw1D5
@Deprecated(since="16.0", forRemoval=true) @Pure void motionNewtonLaw1D5(Vector2D<?,?> velocity, double minSpeed, double maxSpeed, Vector2D<?,?> acceleration, double minAcceleration, double maxAcceleration, double dt, Vector2D<?,?> result)
Deprecated, for removal: This API element is subject to removal in a future version.Compute and replies a motion according to high school physics Newton's equations for motion.This function allows to clamp acceleration and velocity.
From Equation 2 of the SUVAT form:
clamped_acceleration = clamp(acceleration, minAcceleration, maxAcceleration)
new_velocity = velocity + 0.5 * clamped_acceleration * dt
clamped_velocity = clamp(new_velocity, minSpeed, maxSpeed)
motion = clamped_velocity * dt- Parameters:
velocity- is the current velocity of the object. Norm of vector is speed in m/s for example.minSpeed- is the minimal speed allowed.maxSpeed- is the maximal speed allowed.acceleration- is the current acceleration of the object. Norm of vector is acceleration amount in m/s2 for example.minAcceleration- is the minimal acceleration allowed.maxAcceleration- is the maximal acceleration allowed. Length of this vector is the acceleration amount. Direction of this vector becomes movement direction.dt- is the time.result- the motion.- See Also:
- "http://en.wikibooks.org/wiki/High_School_Physics/Velocity"
-
motionNewtonLaw1D5
@Pure void motionNewtonLaw1D5(Vector1D<?,?,?> velocity, double minSpeed, double maxSpeed, Vector1D<?,?,?> acceleration, double minAcceleration, double maxAcceleration, double dt, Vector1D<?,?,?> result)
Compute and replies a motion according to high school physics Newton's equations for motion.This function allows to clamp acceleration and velocity.
From Equation 2 of the SUVAT form:
clamped_acceleration = clamp(acceleration, minAcceleration, maxAcceleration)
new_velocity = velocity + 0.5 * clamped_acceleration * dt
clamped_velocity = clamp(new_velocity, minSpeed, maxSpeed)
motion = clamped_velocity * dt
Caution: The resulting vector has the same segment as the provided vector.
- Parameters:
velocity- is the current velocity of the object. Norm of vector is speed in m/s for example.minSpeed- is the minimal speed allowed.maxSpeed- is the maximal speed allowed.acceleration- is the current acceleration of the object. Norm of vector is acceleration amount in m/s2 for example.minAcceleration- is the minimal acceleration allowed.maxAcceleration- is the maximal acceleration allowed. Length of this vector is the acceleration amount. Direction of this vector becomes movement direction.dt- is the time.result- the motion.- Since:
- 16.0
- See Also:
- "http://en.wikibooks.org/wiki/High_School_Physics/Velocity"
-
motionNewtonLaw2D
@Pure void motionNewtonLaw2D(Vector2D<?,?> velocity, double minSpeed, double maxSpeed, Vector2D<?,?> acceleration, double minAcceleration, double maxAcceleration, double dt, Vector2D<?,?> result)
Compute and replies a motion according to high school physics Newton's equations for motion.This function allows to clamp acceleration and velocity.
From Equation 2 of the SUVAT form:
clamped_acceleration = clamp(acceleration, minAcceleration, maxAcceleration)
new_velocity = velocity + 0.5 * clamped_acceleration * dt
clamped_velocity = clamp(new_velocity, minSpeed, maxSpeed)
motion = clamped_velocity * dt- Parameters:
velocity- is the current velocity of the object. Norm of vector is speed in m/s for example.minSpeed- is the minimal speed allowed.maxSpeed- is the maximal speed allowed.acceleration- is the current acceleration of the object. Norm of vector is acceleration amount in m/s2 for example.minAcceleration- is the minimal acceleration allowed.maxAcceleration- is the maximal acceleration allowed. Length of this vector is the acceleration amount. Direction of this vector becomes movement direction.dt- is the time.result- the motion.- See Also:
- "http://en.wikibooks.org/wiki/High_School_Physics/Velocity"
-
motionNewtonLaw2D5
@Pure void motionNewtonLaw2D5(Vector3D<?,?> velocity, double minSpeed, double maxSpeed, Vector3D<?,?> acceleration, double minAcceleration, double maxAcceleration, double dt, Vector3D<?,?> result)
Compute and replies a motion according to high school physics Newton's equations for motion.This function allows to clamp acceleration and velocity.
From Equation 2 of the SUVAT form:
clamped_acceleration = clamp(acceleration, minAcceleration, maxAcceleration)
new_velocity = velocity + 0.5 * clamped_acceleration * dt
clamped_velocity = clamp(new_velocity, minSpeed, maxSpeed)
motion = clamped_velocity * dt- Parameters:
velocity- is the current velocity of the object. Norm of vector is speed in m/s for example.minSpeed- is the minimal speed allowed.maxSpeed- is the maximal speed allowed.acceleration- is the current acceleration of the object. Norm of vector is acceleration amount in m/s2 for example.minAcceleration- is the minimal acceleration allowed.maxAcceleration- is the maximal acceleration allowed. Length of this vector is the acceleration amount. Direction of this vector becomes movement direction.dt- is the time.result- the motion.- See Also:
- "http://en.wikibooks.org/wiki/High_School_Physics/Velocity"
-
motionNewtonLaw3D
@Pure void motionNewtonLaw3D(Vector3D<?,?> velocity, double minSpeed, double maxSpeed, Vector3D<?,?> acceleration, double minAcceleration, double maxAcceleration, double dt, Vector3D<?,?> result)
Compute and replies a motion according to high school physics Newton's equations for motion.This function allows to clamp acceleration and velocity.
From Equation 2 of the SUVAT form:
clamped_acceleration = clamp(acceleration, minAcceleration, maxAcceleration)
new_velocity = velocity + 0.5 * clamped_acceleration * dt
clamped_velocity = clamp(new_velocity, minSpeed, maxSpeed)
motion = clamped_velocity * dt- Parameters:
velocity- is the current velocity of the object. Norm of vector is speed in m/s for example.minSpeed- is the minimal speed allowed.maxSpeed- is the maximal speed allowed.acceleration- is the current acceleration of the object. Norm of vector is acceleration amount in m/s2 for example.minAcceleration- is the minimal acceleration allowed.maxAcceleration- is the maximal acceleration allowed. Length of this vector is the acceleration amount. Direction of this vector becomes movement direction.dt- is the time.result- the motion.- See Also:
- "http://en.wikibooks.org/wiki/High_School_Physics/Velocity"
-
motionNewtonEuler1Law
@Pure double motionNewtonEuler1Law(double speed, double dt)Compute and replies a motion according to Newton-Euler-1 equations for motion (where acceleration is not significant).From the first-order Newton-Euler method:
movement = speed * dt- Parameters:
speed- is the current speed of the object.dt- is the time- Returns:
- a motion
-
motionNewtonEuler1Law1D
@Pure double motionNewtonEuler1Law1D(double velocity, double minSpeed, double maxSpeed, double dt)Compute and replies a motion according to Newton-Euler-1 equations for motion (where acceleration is not significant).From the first-order Newton-Euler method:
movement = clamp(velocity) * dt- Parameters:
velocity- is the current velocity of the object.minSpeed- is the minimal speed allowed.maxSpeed- is the maximal speed allowed.dt- is the time- Returns:
- a motion
-
motionNewtonEuler1Law1D5
@Pure @Deprecated(since="16.0", forRemoval=true) void motionNewtonEuler1Law1D5(Vector2D<?,?> velocity, double minSpeed, double maxSpeed, double dt, Vector2D<?,?> result)
Deprecated, for removal: This API element is subject to removal in a future version.Compute and replies a motion according to Newton-Euler-1 equations for motion (where acceleration is not significant).From the first-order Newton-Euler method:
movement = clamp(velocity) * dt- Parameters:
velocity- is the current velocity of the object.minSpeed- is the minimal speed allowed (clamped to 0 if negative).maxSpeed- is the maximal speed allowed.dt- is the timeresult- a motion
-
motionNewtonEuler1Law1D5
@Pure void motionNewtonEuler1Law1D5(Vector1D<?,?,?> velocity, double minSpeed, double maxSpeed, double dt, Vector1D<?,?,?> result)
Compute and replies a motion according to Newton-Euler-1 equations for motion (where acceleration is not significant).From the first-order Newton-Euler method:
movement = clamp(velocity) * dtCaution: The resulting vector has the same segment as the provided vector.
- Parameters:
velocity- is the current velocity of the object.minSpeed- is the minimal speed allowed (clamped to 0 if negative).maxSpeed- is the maximal speed allowed.dt- is the timeresult- a motion- Since:
- 16.0
-
motionNewtonEuler1Law2D
@Pure void motionNewtonEuler1Law2D(Vector2D<?,?> velocity, double minSpeed, double maxSpeed, double dt, Vector2D<?,?> result)
Compute and replies a motion according to Newton-Euler-1 equations for motion (where acceleration is not significant).From the first-order Newton-Euler method:
movement = clamp(velocity) * dt- Parameters:
velocity- is the current velocity of the object.minSpeed- is the minimal speed allowed (clamped to 0 if negative).maxSpeed- is the maximal speed allowed.dt- is the timeresult- a motion
-
motionNewtonEuler1Law2D5
@Pure void motionNewtonEuler1Law2D5(Vector3D<?,?> velocity, double minSpeed, double maxSpeed, double dt, Vector3D<?,?> result)
Compute and replies a motion according to Newton-Euler-1 equations for motion (where acceleration is not significant).From the first-order Newton-Euler method:
movement = clamp(velocity) * dt- Parameters:
velocity- is the current velocity of the object.minSpeed- is the minimal speed allowed (clamped to 0 if negative).maxSpeed- is the maximal speed allowed.dt- is the timeresult- a motion
-
motionNewtonEuler1Law3D
@Pure void motionNewtonEuler1Law3D(Vector3D<?,?> velocity, double minSpeed, double maxSpeed, double dt, Vector3D<?,?> result)
Compute and replies a motion according to Newton-Euler-1 equations for motion (where acceleration is not significant).From the first-order Newton-Euler method:
movement = clamp(velocity) * dt- Parameters:
velocity- is the current velocity of the object.minSpeed- is the minimal speed allowed (clamped to 0 if negative).maxSpeed- is the maximal speed allowed.dt- is the timeresult- a motion
-
speed
@Pure double speed(double movement, double dt)Replies the new speed according to a previous speed and a mouvement during a given time.From the first-order Newton-Euler method:
speed = movement / dt- Parameters:
movement- is the movement distance.dt- is the time- Returns:
- a new speed
- Since:
- 4.1
-
acceleration
@Pure double acceleration(double previousSpeed, double currentSpeed, double dt)Replies the new acceleration according to a previous speed and a current speed, and given time.From the second-order Newton-Euler method:
(currentSpeed - previousSpeed) / dt- Parameters:
previousSpeed- is the previous speed of the object.currentSpeed- is the current speed of the object.dt- is the time- Returns:
- a new acceleration
-
-