|
|
void | a_vector3_set (a_vector3 *ctx, a_point3 const *p, a_point3 const *q) |
| | set a 3D vector as the difference from point p to point q.
|
|
void | a_point3_val (a_point3 const *ctx, a_real *x, a_real *y, a_real *z) |
| | get the cartesian coordinates of a 3D point.
|
|
void | a_point3_set_val (a_point3 *ctx, a_real x, a_real y, a_real z) |
| | set the cartesian coordinates of a 3D point.
|
|
void | a_point3_cyl (a_point3 const *ctx, a_real *rho, a_real *theta, a_real *z) |
| | get the cylindrical coordinates of a 3D point.
|
|
void | a_point3_set_cyl (a_point3 *ctx, a_real rho, a_real theta, a_real z) |
| | set the cylindrical coordinates of a 3D point.
|
|
void | a_point3_sph (a_point3 const *ctx, a_real *rho, a_real *theta, a_real *alpha) |
| | get the spherical coordinates of a 3D point.
|
|
void | a_point3_set_sph (a_point3 *ctx, a_real rho, a_real theta, a_real alpha) |
| | set the spherical coordinates of a 3D point.
|
|
void | a_point3_add (a_point3 const *lhs, a_vector3 const *rhs, a_point3 *res) |
| | add a 3D vector to a 3D point.
|
|
void | a_point3_sub (a_point3 const *lhs, a_vector3 const *rhs, a_point3 *res) |
| | subtract a 3D vector from a 3D point.
|
|
void | a_point3_mul (a_point3 const *lhs, a_real rhs, a_point3 *res) |
| | multiplie a 3D point by a scalar.
|
|
void | a_point3_div (a_point3 const *lhs, a_real rhs, a_point3 *res) |
| | divide a 3D point by a scalar.
|
|
void | a_point3_pos (a_point3 const *ctx, a_vector3 *res) |
| | convert it into a vector from the origin to the point.
|
|
void | a_point3_neg (a_point3 const *ctx, a_vector3 *res) |
| | convert it into a vector from the point to the origin.
|
| a_real | a_point3_dist (a_point3 const *lhs, a_point3 const *rhs) |
| | compute the distance between two 3D points.
|
| a_real | a_point3_dist2 (a_point3 const *lhs, a_point3 const *rhs) |
| | compute the squared distance between two 3D points.
|
| a_real | a_point3_mindist (a_point3 const *ctx, a_point3 const *i_p, a_size i_n, a_point3 *o_p, a_size *o_i) |
| | compute the minimum distance from a reference point to a point set.
|
| a_real | a_point3_maxdist (a_point3 const *ctx, a_point3 const *i_p, a_size i_n, a_point3 *o_p, a_size *o_i) |
| | compute the maximum distance from a reference point to a point set.
|
| int | a_point3_cmpxy (a_point3 const *lhs, a_point3 const *rhs) |
| | compare two 3D points primarily by X, then by Y, and finally by Z.
|
| int | a_point3_cmpyx (a_point3 const *lhs, a_point3 const *rhs) |
| | compare two 3D points primarily by Y, then by X, and finally by Z.
|
| void | a_vector3::set (a_point3 const &p, a_point3 const &q) |
| | set a 3D vector as the difference from point p to point q.
|
compute the distance between two 3D points.
In three-dimensional space, let point \(p\) have coordinates \((p_x,p_y,p_z)\) and let point \(q\) have coordinates \((q_x,q_y,q_z)\). Then the distance between \(p\) and \(q\) is given by:
\[ d(p,q)=\sqrt{(p_x-q_x)^2+(p_y-q_y)^2+(p_z-q_z)^2}
\]
- Parameters
-
| [in] | lhs | is left-hand side 3D point |
| [in] | rhs | is right-hand side 3D point |
- Returns
- the distance between two 3D points
compute the squared distance between two 3D points.
In three-dimensional space, let point \(p\) have coordinates \((p_x,p_y,p_z)\) and let point \(q\) have coordinates \((q_x,q_y,q_z)\). Then the squared distance between \(p\) and \(q\) is given by:
\[ d(p,q)^2=(p_x-q_x)^2+(p_y-q_y)^2+(p_z-q_z)^2
\]
- Parameters
-
| [in] | lhs | is left-hand side 3D point |
| [in] | rhs | is right-hand side 3D point |
- Returns
- the squared distance between two 3D points