Zephyr Scientific Library (zscilib)
Files | Functions
Rotation

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...
 

Detailed Description

Rotation functions.

Function Documentation

◆ zsl_phy_rot_accel()

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).

Parameters
aAngular acceleration in radians per second squared.
rRadius of the circular trajectory in meters.
accelPointer to the output tangencial acceleration in meters per second squared. Will be set to NAN if the radius is negative.
Returns
0 on success, and non-zero error code on failure.

◆ zsl_phy_rot_ang_accel()

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.

Parameters
oiInitial angular velocity in radians per second.
ofFinal angular velocity in radians per second.
timeTime in seconds.
aPointer to the output angular acceleration in radians per second. Will be set to NAN if the time is negative or zero.
Returns
0 on success, and non-zero error code on failure.

◆ zsl_phy_rot_angle()

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.

Parameters
oiInitial angular velocity in radians per second.
timeTime in seconds.
aAngular acceleration in radians per second squared.
phiPointer to the placeholder for calculated change in the angle in radians. Will be set to NAN if time is a negative value.
Returns
0 on success, and non-zero error code on failure.

◆ zsl_phy_rot_av_omega()

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).

Parameters
phiAngle run by the object in radians.
timeTime in seconds.
omegaPointer to the output average angular velocity in radians per second. Will be set to NAN if the time is negative or zero.
Returns
0 on success, and non-zero error code on failure.

◆ zsl_phy_rot_cent_accel()

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).

Parameters
velTangencial velocity in meters per second.
rRadius of the circular trajectory in meters.
caPointer to the output centripetal acceleration in meters per second squared. Will be set to NAN if the radius is negative or zero.
Returns
0 on success, and non-zero error code on failure.

◆ zsl_phy_rot_cent_accel2()

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).

Parameters
tPeriod in second.
rRadius of the circular trajectory in meters.
caPointer 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.
Returns
0 on success, and non-zero error code on failure.

◆ zsl_phy_rot_dist()

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).

Parameters
phiTotal change in angle by the object in radians.
rRadius of the circular trajectory in meters.
distPointer to the output distance in meters. Will be set to NAN if r is a negative value.
Returns
0 on success, and non-zero error code on failure.

◆ zsl_phy_rot_ener()

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).

Parameters
omegaAngular velocity in radians per second.
iMoment of inertia of the object in kilograms and meters squared.
rkePointer to the output angular kinetic energy in joules. Will be set to NAN if the moment of inertia is negative.
Returns
0 on success, and non-zero error code on failure.

◆ zsl_phy_rot_frequency()

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).

Parameters
omegaAngular velocity in radians per second.
fPointer to the output frequency in herzs. Will be set to NAN if the angular velocity is negative.
Returns
0 on success, and non-zero error code on failure.

◆ zsl_phy_rot_omega()

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).

Parameters
oiInitial angular velocity in radians per second.
timeTime in seconds.
aAngular acceleration in radians per second squared.
ofPointer to the output final angular velocity in radians per second. Will be set to NAN if the time is negative.
Returns
0 on success, and non-zero error code on failure.

◆ zsl_phy_rot_omega2()

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).

Parameters
oiInitial angular velocity in radians per second.
phiAngle run by the object in radians.
aAngular acceleration in radians per second squared.
ofPointer to the output final angular velocity in radians per second. Will be set to NAN if the angular velocity takes a complex value.
Returns
0 on success, and non-zero error code on failure.

◆ zsl_phy_rot_period()

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).

Parameters
omegaAngular velocity in radians per second.
tPointer to the output period in seconds. Will be set to NAN if the angular velocity is zero or negative.
Returns
0 on success, and non-zero error code on failure.

◆ zsl_phy_rot_power()

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).

Parameters
torqueTorque in kilograms and meters squared per second.
omegaAngular velocity in radians per second.
powerPointer to the output total power in watts.
Returns
0 on success, and non-zero error code on failure.

◆ zsl_phy_rot_time()

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).

Parameters
oiInitial angular velocity in radians per second.
ofFinal angular velocity in radians per second.
aAngular acceleration in radians per second squared.
timePointer to the placeholder for calculated time in seconds. Will be set to NAN if the time is negative or if a is zero.
Returns
0 on success, and non-zero error code on failure.

◆ zsl_phy_rot_total_accel()

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.

Parameters
accelTangencial acceleration in meters per second squared.
caCentripetal acceleration in meters per second squared.
atPointer to the output total acceleration in meters per second squared.
Returns
0 on success, and non-zero error code on failure.

◆ zsl_phy_rot_turn()

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).

Parameters
phiTotal change in angle travelled by the object in radians.
turnPointer to the output number of rotations.
Returns
0 on success, and non-zero error code on failure.

◆ zsl_phy_rot_vel()

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).

Parameters
omegaInstant angular velocity in radians per second.
rRadius of the circular trajectory in meters.
velPointer to the output tangencial velocity in meters per second. Will be set to NAN if the radius is negative.
Returns
0 on success, and non-zero error code on failure.