|
|
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.
|
| void | a_vector2::set (a_point2 const &p, a_point2 const &q) |
| | set a 2D vector as the difference from point p to point q.
|
compute the distance between two 2D points.
In two-dimensional space, let point \(p\) have coordinates \((p_x,p_y)\) and let point \(q\) have coordinates \((q_x,q_y)\). Then the distance between \(p\) and \(q\) is given by:
\[ d(p,q)=\sqrt{(p_x-q_x)^2+(p_y-q_y)^2}
\]
- Parameters
-
| [in] | lhs | is left-hand side 2D point |
| [in] | rhs | is right-hand side 2D point |
- Returns
- the distance between two 2D points
compute the squared distance between two 2D points.
In two-dimensional space, let point \(p\) have coordinates \((p_x,p_y)\) and let point \(q\) have coordinates \((q_x,q_y)\). 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
\]
- Parameters
-
| [in] | lhs | is left-hand side 2D point |
| [in] | rhs | is right-hand side 2D point |
- Returns
- the squared distance between two 2D points