Zephyr Scientific Library (zscilib)
|
Kinematics functions. More...
Files | |
file | kinematics.h |
API header file for kinematics in zscilib. | |
Functions | |
int | zsl_phy_kin_dist (zsl_real_t vi, zsl_real_t time, zsl_real_t accel, zsl_real_t *dist) |
Calculates the change in distance based on initial velocity, time and acceleration. More... | |
int | zsl_phy_kin_init_pos (zsl_real_t vi, zsl_real_t t, zsl_real_t a, zsl_real_t xf, zsl_real_t *xi) |
Calculates the initial position of a moving body based on the final position (xf), the initial velocity (vi), acceleration (a) and time (t). More... | |
int | zsl_phy_kin_init_pos2 (zsl_real_t vi, zsl_real_t vf, zsl_real_t a, zsl_real_t xf, zsl_real_t *xi) |
Calculates the initial position of a moving body based on the final position (xf), the initial velocity (vi), the final velocity (vf) and acceleration (a). More... | |
int | zsl_phy_kin_time (zsl_real_t vi, zsl_real_t vf, zsl_real_t accel, zsl_real_t *time) |
Calculates the time in seconds that it takes an object to change its velocity from vi to vf under a constant acceleration (accel). More... | |
int | zsl_phy_kin_vel (zsl_real_t vi, zsl_real_t time, zsl_real_t accel, zsl_real_t *vf) |
Calculates the velocity in meters per second of an object under a constant acceleration (accel) based on its initial velocity (vi) and the time passed since it started moving (time). More... | |
int | zsl_phy_kin_vel2 (zsl_real_t vi, zsl_real_t dist, zsl_real_t accel, zsl_real_t *vf) |
Calculates the velocity in meters per second of an object under a constant acceleration (accel) based on its initial velocity (vi) and the distance traveled from the starting point (dist). More... | |
int | zsl_phy_kin_init_vel (zsl_real_t vf, zsl_real_t a, zsl_real_t t, zsl_real_t *vi) |
Calculates the initial velocity in meters per second of an object under a constant acceleration (a) based on its final velocity (vf) and time (t). More... | |
int | zsl_phy_kin_init_vel2 (zsl_real_t dist, zsl_real_t a, zsl_real_t t, zsl_real_t *vi) |
Calculates the initial velocity in meters per second of an object under a constant acceleration (a) based on the distance it has travelled (dist) and time (t). More... | |
int | zsl_phy_kin_init_vel3 (zsl_real_t vf, zsl_real_t a, zsl_real_t dist, zsl_real_t *vi) |
Calculates the initial velocity in meters per second of an object under a constant acceleration (a) based on the distance it has travelled (dist) and the final velocity (vf). More... | |
int | zsl_phy_kin_av_vel (zsl_real_t dist, zsl_real_t time, zsl_real_t *vel) |
Calculates the average velocity in meters per second of a moving object based on the time and distance. More... | |
int | zsl_phy_kin_accel (zsl_real_t vi, zsl_real_t vf, zsl_real_t time, zsl_real_t *accel) |
Calculates the acceleration of a moving body in meters per second squared based on its initial (vi) and final (vf) velocities and time. More... | |
int | zsl_phy_kin_ener (zsl_real_t v, zsl_real_t m, zsl_real_t *ke) |
Calculates the kinetic energy in joules of a moving body based on its velocity (v) and mass (m). More... | |
Kinematics functions.
int zsl_phy_kin_accel | ( | zsl_real_t | vi, |
zsl_real_t | vf, | ||
zsl_real_t | time, | ||
zsl_real_t * | accel | ||
) |
Calculates the acceleration of a moving body in meters per second squared based on its initial (vi) and final (vf) velocities and time.
vi | Initial velocity in meters per second. |
vf | Final velocity in meters per second. |
time | Time in seconds. |
accel | Pointer to the output acceleration in meters per second squared. Will be set to NAN if the time is negative or zero. |
int zsl_phy_kin_av_vel | ( | zsl_real_t | dist, |
zsl_real_t | time, | ||
zsl_real_t * | vel | ||
) |
Calculates the average velocity in meters per second of a moving object based on the time and distance.
dist | Distance in meters. |
time | Time in seconds. |
vel | Pointer to the output velocity in meters per second. Will be set to NAN if the time is negative or zero. |
int zsl_phy_kin_dist | ( | zsl_real_t | vi, |
zsl_real_t | time, | ||
zsl_real_t | accel, | ||
zsl_real_t * | dist | ||
) |
Calculates the change in distance based on initial velocity, time and acceleration.
vi | Initial velocity in meters per second. |
time | Time in seconds. |
accel | Acceleration in meters per second squared. |
dist | Pointer to the placeholder for calculated distance in meters. Will be set to NAN if time is a negative value. |
int zsl_phy_kin_ener | ( | zsl_real_t | v, |
zsl_real_t | m, | ||
zsl_real_t * | ke | ||
) |
Calculates the kinetic energy in joules of a moving body based on its velocity (v) and mass (m).
v | Velocity of the object in meters per second. |
m | Mass of the object in kilograms. |
ke | Pointer to the output kinetic energy in joules. Will be set to NAN if the mass is negative. |
int zsl_phy_kin_init_pos | ( | zsl_real_t | vi, |
zsl_real_t | t, | ||
zsl_real_t | a, | ||
zsl_real_t | xf, | ||
zsl_real_t * | xi | ||
) |
Calculates the initial position of a moving body based on the final position (xf), the initial velocity (vi), acceleration (a) and time (t).
vi | Initial velocity in meters per second. |
t | Time in seconds. |
a | Acceleration in meters per second squared. |
xf | Final position in meters. |
xi | Pointer to the placeholder for the initial position in meters. Will be set to NAN if time is a negative value. |
int zsl_phy_kin_init_pos2 | ( | zsl_real_t | vi, |
zsl_real_t | vf, | ||
zsl_real_t | a, | ||
zsl_real_t | xf, | ||
zsl_real_t * | xi | ||
) |
Calculates the initial position of a moving body based on the final position (xf), the initial velocity (vi), the final velocity (vf) and acceleration (a).
vi | Initial velocity in meters per second. |
vf | Final velocity in meters per second. |
a | Acceleration in meters per second squared. |
xf | Final position in meters. |
xi | Pointer to the placeholder for the initial position in meters. Will be set to NAN if the acceleration's value is zero. |
int zsl_phy_kin_init_vel | ( | zsl_real_t | vf, |
zsl_real_t | a, | ||
zsl_real_t | t, | ||
zsl_real_t * | vi | ||
) |
Calculates the initial velocity in meters per second of an object under a constant acceleration (a) based on its final velocity (vf) and time (t).
vf | Final velocity in meters per second. |
a | Acceleration in meters per second squared. |
t | Time in seconds. |
vi | Pointer to the output initial velocity in meters per second. Will be set to NAN if the time is negative. |
int zsl_phy_kin_init_vel2 | ( | zsl_real_t | dist, |
zsl_real_t | a, | ||
zsl_real_t | t, | ||
zsl_real_t * | vi | ||
) |
Calculates the initial velocity in meters per second of an object under a constant acceleration (a) based on the distance it has travelled (dist) and time (t).
dist | Distance in meters. |
a | Acceleration in meters per second squared. |
t | Time in seconds. |
vi | Pointer to the output initial velocity in meters per second. Will be set to NAN if the time is negative or zero. |
int zsl_phy_kin_init_vel3 | ( | zsl_real_t | vf, |
zsl_real_t | a, | ||
zsl_real_t | dist, | ||
zsl_real_t * | vi | ||
) |
Calculates the initial velocity in meters per second of an object under a constant acceleration (a) based on the distance it has travelled (dist) and the final velocity (vf).
vf | Final velocity in meters per second. |
a | Acceleration in meters per second squared. |
dist | Distance in meters. |
vi | Pointer to the output initial velocity in meters per second. Will be set to NAN if the output velocity takes a complex value. |
int zsl_phy_kin_time | ( | zsl_real_t | vi, |
zsl_real_t | vf, | ||
zsl_real_t | accel, | ||
zsl_real_t * | time | ||
) |
Calculates the time in seconds that it takes an object to change its velocity from vi to vf under a constant acceleration (accel).
vi | Initial velocity in meters per second. |
vf | Final velocity in meters per second. |
accel | Acceleration in meters per second squared. |
time | Pointer to the placeholder for calculated time in seconds. Will be set to NAN if the time is negative or if the acceleration is zero. |
int zsl_phy_kin_vel | ( | zsl_real_t | vi, |
zsl_real_t | time, | ||
zsl_real_t | accel, | ||
zsl_real_t * | vf | ||
) |
Calculates the velocity in meters per second of an object under a constant acceleration (accel) based on its initial velocity (vi) and the time passed since it started moving (time).
vi | Initial velocity in meters per second. |
time | Time in seconds. |
accel | Acceleration in meters per second squared. |
vf | Pointer to the output velocity in meters per second. Will be set to NAN if the time is negative. |
int zsl_phy_kin_vel2 | ( | zsl_real_t | vi, |
zsl_real_t | dist, | ||
zsl_real_t | accel, | ||
zsl_real_t * | vf | ||
) |
Calculates the velocity in meters per second of an object under a constant acceleration (accel) based on its initial velocity (vi) and the distance traveled from the starting point (dist).
vi | Initial velocity in meters per second. |
dist | Distance in meters. |
accel | Acceleration in meters per second squared. |
vf | Pointer to the output velocity in meters per second. Will be set to NAN if the velocity takes a complex value. |