|
liba 0.1.15
An algorithm library based on C/C++
|
two-dimensional point More...
Go to the source code of this file.
Data Structures | |
| struct | a_point2 |
| instance structure for two-dimensional point More... | |
Macros | |
| #define | A_POINT2_C(x, y) |
| #define | a_point2_c(x) |
| #define | a_point2_(_, x) |
Typedefs | |
| typedef struct a_point2 | a_point2 |
| typedef struct a_point2 | a::point2 |
Functions | |
| void | a_vector2_set (a_vector2 *ctx, a_point2 const *p, a_point2 const *q) |
| set a 2D vector as the difference from point p to point q. | |
| void | a_point2_val (a_point2 const *ctx, a_real *x, a_real *y) |
| get the cartesian coordinates of a 2D point. | |
| void | a_point2_set_val (a_point2 *ctx, a_real x, a_real y) |
| set the cartesian coordinates of a 2D point. | |
| void | a_point2_pol (a_point2 const *ctx, a_real *rho, a_real *theta) |
| get the polar coordinates of a 2D point. | |
| void | a_point2_set_pol (a_point2 *ctx, a_real rho, a_real theta) |
| set the polar coordinates of a 2D point. | |
| void | a_point2_add (a_point2 const *lhs, a_vector2 const *rhs, a_point2 *res) |
| add a 2D vector to a 2D point. | |
| void | a_point2_sub (a_point2 const *lhs, a_vector2 const *rhs, a_point2 *res) |
| subtract a 2D vector from a 2D point. | |
| void | a_point2_mul (a_point2 const *lhs, a_real rhs, a_point2 *res) |
| multiplie a 2D point by a scalar. | |
| void | a_point2_div (a_point2 const *lhs, a_real rhs, a_point2 *res) |
| divide a 2D point by a scalar. | |
| void | a_point2_pos (a_point2 const *ctx, a_vector2 *res) |
| convert it into a vector from the origin to the point. | |
| void | a_point2_neg (a_point2 const *ctx, a_vector2 *res) |
| convert it into a vector from the point to the origin. | |
| a_real | a_point2_dist (a_point2 const *lhs, a_point2 const *rhs) |
| compute the distance between two 2D points. | |
| a_real | a_point2_dist2 (a_point2 const *lhs, a_point2 const *rhs) |
| compute the squared distance between two 2D points. | |
| a_real | a_point2_mindist (a_point2 const *ctx, a_point2 const *i_p, a_size i_n, a_point2 *o_p, a_size *o_i) |
| compute the minimum distance from a reference point to a point set. | |
| a_real | a_point2_maxdist (a_point2 const *ctx, a_point2 const *i_p, a_size i_n, a_point2 *o_p, a_size *o_i) |
| compute the maximum distance from a reference point to a point set. | |
| int | a_point2_cmpx (a_point2 const *lhs, a_point2 const *rhs) |
| compare two 2D points primarily by X-coordinate, then by Y-coordinate. | |
| int | a_point2_cmpy (a_point2 const *lhs, a_point2 const *rhs) |
| compare two 2D points primarily by Y-coordinate, then by X-coordinate. | |
two-dimensional point