Zephyr Scientific Library (zscilib)
|
Rotation functions. More...
Files | |
file | rotation.h |
API header file for rotation in zscilib. | |
Functions | |
int | zsl_phy_rot_angle (zsl_real_t oi, zsl_real_t time, zsl_real_t a, zsl_real_t *phi) |
Calculates the change in the angle based on initial angular velocity, time and acceleration. More... | |
int | zsl_phy_rot_dist (zsl_real_t phi, zsl_real_t r, zsl_real_t *dist) |
Calculates the distance travelled in meters by an object under circular motion given the change in angle in radians (phi) and the radius of its trajectory (r). More... | |
int | zsl_phy_rot_turn (zsl_real_t phi, zsl_real_t *turn) |
Calculates the number of rotations around a circle by an object under circular motion, based on the total change in angle it has travelled in radians (phi). More... | |
int | zsl_phy_rot_time (zsl_real_t oi, zsl_real_t of, zsl_real_t a, zsl_real_t *time) |
Calculates the time in seconds that it takes an object to change its angular velocity from 'oi' to 'of' under a constant angular acceleration (a). More... | |
int | zsl_phy_rot_omega (zsl_real_t oi, zsl_real_t time, zsl_real_t a, zsl_real_t *of) |
Calculates the final angular velocity in radians per second of an object under a constant angular acceleration (a) based on its initial angular velocity (oi) and the time passed since it started moving (time). More... | |
int | zsl_phy_rot_omega2 (zsl_real_t oi, zsl_real_t phi, zsl_real_t a, zsl_real_t *of) |
Calculates the final angular velocity in radians per second of an object under a constant angular acceleration (a) based on its initial angular velocity (oi) and the angle it has run (phy). More... | |
int | zsl_phy_rot_av_omega (zsl_real_t phi, zsl_real_t time, zsl_real_t *omega) |
Calculates the average angular velocity in radians per second of an object under circular motion based on the time and the angle it has run (phy). More... | |
int | zsl_phy_rot_vel (zsl_real_t omega, zsl_real_t r, zsl_real_t *vel) |
Calculates the module of the velocity tangent to the circular trajectory of an object under circular motion, based on its instant angular velocity (omega) and the radius of its trajectory (r). More... | |
int | zsl_phy_rot_ang_accel (zsl_real_t oi, zsl_real_t of, zsl_real_t time, zsl_real_t *a) |
Calculates the angular acceleration of an object under circular motion in radians per second squared based on its initial (oi) and final (of) angular velocities and time. More... | |
int | zsl_phy_rot_accel (zsl_real_t a, zsl_real_t r, zsl_real_t *accel) |
Calculates the module of the acceleration tangent to the circular trajectory of an object under circular motion, based on its angular acceleration (a) and the radius of its trajectory (r). More... | |
int | zsl_phy_rot_ener (zsl_real_t omega, zsl_real_t i, zsl_real_t *rke) |
Calculates the angular kinetic energy in joules of an object under circular motion based on its angular velocity (omega) and its moment of inertia (i). More... | |
int | zsl_phy_rot_period (zsl_real_t omega, zsl_real_t *t) |
Calculates the period in seconds of an object under circular motion given its angular velocity (omega). More... | |
int | zsl_phy_rot_frequency (zsl_real_t omega, zsl_real_t *f) |
Calculates the frequency in herzs of an object under circular motion given its angular velocity (omega). More... | |
int | zsl_phy_rot_cent_accel (zsl_real_t vel, zsl_real_t r, zsl_real_t *ca) |
Calculates the module of the centripetal (AKA normal) acceleration experienced by an object moving under circular motion, given its tangencial velocity (vel) and the radius of its trajectory (r). More... | |
int | zsl_phy_rot_cent_accel2 (zsl_real_t t, zsl_real_t r, zsl_real_t *ca) |
Calculates the module of the centripetal (AKA normal) acceleration experienced by an object moving under circular motion, given its period (t) and the radius of its trajectory (r). More... | |
int | zsl_phy_rot_total_accel (zsl_real_t accel, zsl_real_t ca, zsl_real_t *at) |
Calculates the module of the total acceleration in meters per second squared of an object moving under circular motion combining its tangencial (accel) and centripetal (ca) accelerations. More... | |
int | zsl_phy_rot_power (zsl_real_t torque, zsl_real_t omega, zsl_real_t *power) |
Calculates the mechanical power in watts necessary to mantain a circular motion given its torque and angular velocity (omega). More... | |
Rotation functions.
int zsl_phy_rot_accel | ( | zsl_real_t | a, |
zsl_real_t | r, | ||
zsl_real_t * | accel | ||
) |
Calculates the module of the acceleration tangent to the circular trajectory of an object under circular motion, based on its angular acceleration (a) and the radius of its trajectory (r).
a | Angular acceleration in radians per second squared. |
r | Radius of the circular trajectory in meters. |
accel | Pointer to the output tangencial acceleration in meters per second squared. Will be set to NAN if the radius is negative. |
int zsl_phy_rot_ang_accel | ( | zsl_real_t | oi, |
zsl_real_t | of, | ||
zsl_real_t | time, | ||
zsl_real_t * | a | ||
) |
Calculates the angular acceleration of an object under circular motion in radians per second squared based on its initial (oi) and final (of) angular velocities and time.
oi | Initial angular velocity in radians per second. |
of | Final angular velocity in radians per second. |
time | Time in seconds. |
a | Pointer to the output angular acceleration in radians per second. Will be set to NAN if the time is negative or zero. |
int zsl_phy_rot_angle | ( | zsl_real_t | oi, |
zsl_real_t | time, | ||
zsl_real_t | a, | ||
zsl_real_t * | phi | ||
) |
Calculates the change in the angle based on initial angular velocity, time and acceleration.
oi | Initial angular velocity in radians per second. |
time | Time in seconds. |
a | Angular acceleration in radians per second squared. |
phi | Pointer to the placeholder for calculated change in the angle in radians. Will be set to NAN if time is a negative value. |
int zsl_phy_rot_av_omega | ( | zsl_real_t | phi, |
zsl_real_t | time, | ||
zsl_real_t * | omega | ||
) |
Calculates the average angular velocity in radians per second of an object under circular motion based on the time and the angle it has run (phy).
phi | Angle run by the object in radians. |
time | Time in seconds. |
omega | Pointer to the output average angular velocity in radians per second. Will be set to NAN if the time is negative or zero. |
int zsl_phy_rot_cent_accel | ( | zsl_real_t | vel, |
zsl_real_t | r, | ||
zsl_real_t * | ca | ||
) |
Calculates the module of the centripetal (AKA normal) acceleration experienced by an object moving under circular motion, given its tangencial velocity (vel) and the radius of its trajectory (r).
vel | Tangencial velocity in meters per second. |
r | Radius of the circular trajectory in meters. |
ca | Pointer to the output centripetal acceleration in meters per second squared. Will be set to NAN if the radius is negative or zero. |
int zsl_phy_rot_cent_accel2 | ( | zsl_real_t | t, |
zsl_real_t | r, | ||
zsl_real_t * | ca | ||
) |
Calculates the module of the centripetal (AKA normal) acceleration experienced by an object moving under circular motion, given its period (t) and the radius of its trajectory (r).
t | Period in second. |
r | Radius of the circular trajectory in meters. |
ca | Pointer to the output centripetal acceleration in meters per second squared. Will be set to NAN if the period is negative or zero or if the radius is negative. |
int zsl_phy_rot_dist | ( | zsl_real_t | phi, |
zsl_real_t | r, | ||
zsl_real_t * | dist | ||
) |
Calculates the distance travelled in meters by an object under circular motion given the change in angle in radians (phi) and the radius of its trajectory (r).
phi | Total change in angle by the object in radians. |
r | Radius of the circular trajectory in meters. |
dist | Pointer to the output distance in meters. Will be set to NAN if r is a negative value. |
int zsl_phy_rot_ener | ( | zsl_real_t | omega, |
zsl_real_t | i, | ||
zsl_real_t * | rke | ||
) |
Calculates the angular kinetic energy in joules of an object under circular motion based on its angular velocity (omega) and its moment of inertia (i).
omega | Angular velocity in radians per second. |
i | Moment of inertia of the object in kilograms and meters squared. |
rke | Pointer to the output angular kinetic energy in joules. Will be set to NAN if the moment of inertia is negative. |
int zsl_phy_rot_frequency | ( | zsl_real_t | omega, |
zsl_real_t * | f | ||
) |
Calculates the frequency in herzs of an object under circular motion given its angular velocity (omega).
omega | Angular velocity in radians per second. |
f | Pointer to the output frequency in herzs. Will be set to NAN if the angular velocity is negative. |
int zsl_phy_rot_omega | ( | zsl_real_t | oi, |
zsl_real_t | time, | ||
zsl_real_t | a, | ||
zsl_real_t * | of | ||
) |
Calculates the final angular velocity in radians per second of an object under a constant angular acceleration (a) based on its initial angular velocity (oi) and the time passed since it started moving (time).
oi | Initial angular velocity in radians per second. |
time | Time in seconds. |
a | Angular acceleration in radians per second squared. |
of | Pointer to the output final angular velocity in radians per second. Will be set to NAN if the time is negative. |
int zsl_phy_rot_omega2 | ( | zsl_real_t | oi, |
zsl_real_t | phi, | ||
zsl_real_t | a, | ||
zsl_real_t * | of | ||
) |
Calculates the final angular velocity in radians per second of an object under a constant angular acceleration (a) based on its initial angular velocity (oi) and the angle it has run (phy).
oi | Initial angular velocity in radians per second. |
phi | Angle run by the object in radians. |
a | Angular acceleration in radians per second squared. |
of | Pointer to the output final angular velocity in radians per second. Will be set to NAN if the angular velocity takes a complex value. |
int zsl_phy_rot_period | ( | zsl_real_t | omega, |
zsl_real_t * | t | ||
) |
Calculates the period in seconds of an object under circular motion given its angular velocity (omega).
omega | Angular velocity in radians per second. |
t | Pointer to the output period in seconds. Will be set to NAN if the angular velocity is zero or negative. |
int zsl_phy_rot_power | ( | zsl_real_t | torque, |
zsl_real_t | omega, | ||
zsl_real_t * | power | ||
) |
Calculates the mechanical power in watts necessary to mantain a circular motion given its torque and angular velocity (omega).
torque | Torque in kilograms and meters squared per second. |
omega | Angular velocity in radians per second. |
power | Pointer to the output total power in watts. |
int zsl_phy_rot_time | ( | zsl_real_t | oi, |
zsl_real_t | of, | ||
zsl_real_t | a, | ||
zsl_real_t * | time | ||
) |
Calculates the time in seconds that it takes an object to change its angular velocity from 'oi' to 'of' under a constant angular acceleration (a).
oi | Initial angular velocity in radians per second. |
of | Final angular velocity in radians per second. |
a | Angular acceleration in radians 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 a is zero. |
int zsl_phy_rot_total_accel | ( | zsl_real_t | accel, |
zsl_real_t | ca, | ||
zsl_real_t * | at | ||
) |
Calculates the module of the total acceleration in meters per second squared of an object moving under circular motion combining its tangencial (accel) and centripetal (ca) accelerations.
accel | Tangencial acceleration in meters per second squared. |
ca | Centripetal acceleration in meters per second squared. |
at | Pointer to the output total acceleration in meters per second squared. |
int zsl_phy_rot_turn | ( | zsl_real_t | phi, |
zsl_real_t * | turn | ||
) |
Calculates the number of rotations around a circle by an object under circular motion, based on the total change in angle it has travelled in radians (phi).
phi | Total change in angle travelled by the object in radians. |
turn | Pointer to the output number of rotations. |
int zsl_phy_rot_vel | ( | zsl_real_t | omega, |
zsl_real_t | r, | ||
zsl_real_t * | vel | ||
) |
Calculates the module of the velocity tangent to the circular trajectory of an object under circular motion, based on its instant angular velocity (omega) and the radius of its trajectory (r).
omega | Instant angular velocity in radians per second. |
r | Radius of the circular trajectory in meters. |
vel | Pointer to the output tangencial velocity in meters per second. Will be set to NAN if the radius is negative. |