File syn_transform.h¶
FileList > src > syntropic > util > syn_transform.h
Go to the source code of this file
Fixed-point Q16.16 Coordinate System Transformations (Polar, Spherical, Cartesian).
#include "../common/syn_defs.h"#include "syn_qmath.h"
Public Functions¶
| Type | Name |
|---|---|
| void | syn_cart2pol (q16_t x, q16_t y, q16_t * r, q16_t * theta) Convert 2D Cartesian coordinates (x, y) to Polar coordinates (r, theta). |
| void | syn_cart2sph (q16_t x, q16_t y, q16_t z, q16_t * r, q16_t * theta, q16_t * phi) Convert 3D Cartesian coordinates (x, y, z) to Spherical coordinates (r, theta, phi). |
| void | syn_pol2cart (q16_t r, q16_t theta, q16_t * x, q16_t * y) Convert 2D Polar coordinates (r, theta) to Cartesian coordinates (x, y). |
| void | syn_sph2cart (q16_t r, q16_t theta, q16_t phi, q16_t * x, q16_t * y, q16_t * z) Convert 3D Spherical coordinates (r, theta, phi) to Cartesian coordinates (x, y, z). |
Public Functions Documentation¶
function syn_cart2pol¶
Convert 2D Cartesian coordinates (x, y) to Polar coordinates (r, theta).
Parameters:
xX coordinate in Q16.yY coordinate in Q16.rOutput radius r in Q16.thetaOutput angle theta in Q16 radians [-pi, pi].
function syn_cart2sph¶
Convert 3D Cartesian coordinates (x, y, z) to Spherical coordinates (r, theta, phi).
Parameters:
xX coordinate in Q16.yY coordinate in Q16.zZ coordinate in Q16.rOutput radius r in Q16.thetaOutput azimuth angle theta in Q16 radians [-pi, pi].phiOutput polar angle (inclination) phi in Q16 radians [0, pi].
function syn_pol2cart¶
Convert 2D Polar coordinates (r, theta) to Cartesian coordinates (x, y).
Parameters:
rRadius r in Q16.thetaAngle theta in Q16 radians.xOutput X coordinate in Q16.yOutput Y coordinate in Q16.
function syn_sph2cart¶
Convert 3D Spherical coordinates (r, theta, phi) to Cartesian coordinates (x, y, z).
Parameters:
rRadius r in Q16.thetaAzimuth angle theta in Q16 radians.phiPolar angle (inclination) phi in Q16 radians.xOutput X coordinate in Q16.yOutput Y coordinate in Q16.zOutput Z coordinate in Q16.
The documentation for this class was generated from the following file src/syntropic/util/syn_transform.h