Zephyr Scientific Library (zscilib)
Files | Functions

Work functions. More...

Files

file  work.h
 API header file for work in zscilib.
 

Functions

int zsl_phy_work_module (zsl_real_t f, zsl_real_t d, zsl_real_t *w)
 Calculates the module of the work done by a force (f) along a distance (d). More...
 
int zsl_phy_work_x (zsl_real_t f, zsl_real_t d, zsl_real_t theta, zsl_real_t *w)
 Calculates the horizontal component of the work done by a force (f) along a distance (d). More...
 
int zsl_phy_work_y (zsl_real_t f, zsl_real_t d, zsl_real_t theta, zsl_real_t *w)
 Calculates the vertical component of the work done by a force (f) along a distance (d). More...
 
int zsl_phy_work_kin (zsl_real_t k1, zsl_real_t k2, zsl_real_t *w)
 Calculates the work required to change the kinetic energy of an object from 'k1' to 'k2'. More...
 

Detailed Description

Work functions.

Function Documentation

◆ zsl_phy_work_kin()

int zsl_phy_work_kin ( zsl_real_t  k1,
zsl_real_t  k2,
zsl_real_t w 
)

Calculates the work required to change the kinetic energy of an object from 'k1' to 'k2'.

Parameters
k1Initial kinetic energy of the object in joules.
k2Final kinetic energy of the object in joules.
wPointer to the output work in joules.
Returns
0 if everything executed properly, error code on failure.

◆ zsl_phy_work_module()

int zsl_phy_work_module ( zsl_real_t  f,
zsl_real_t  d,
zsl_real_t w 
)

Calculates the module of the work done by a force (f) along a distance (d).

Parameters
fApplied force in newtons.
dDistance in meters.
wPointer to the output work in joules. Will be set to NAN if either the force or the distance are negative.
Returns
0 if everything executed properly, error code on failure.

◆ zsl_phy_work_x()

int zsl_phy_work_x ( zsl_real_t  f,
zsl_real_t  d,
zsl_real_t  theta,
zsl_real_t w 
)

Calculates the horizontal component of the work done by a force (f) along a distance (d).

Parameters
fApplied force in newtons.
dDistance in meters.
thetaThe angle between the force and distance vectors.
wPointer to the output work in the x-axis in joules. Will be set to NAN if either the force or the distance are negative.
Returns
0 if everything executed properly, error code on failure.

◆ zsl_phy_work_y()

int zsl_phy_work_y ( zsl_real_t  f,
zsl_real_t  d,
zsl_real_t  theta,
zsl_real_t w 
)

Calculates the vertical component of the work done by a force (f) along a distance (d).

Parameters
fApplied force in newtons.
dDistance in meters.
thetaThe angle between the force and distance vectors.
wPointer to the output work in the y-axis in joules. Will be set to NAN if either the force or the distance are negative.
Returns
0 if everything executed properly, error code on failure.