|
liba 0.1.15
An algorithm library based on C/C++
|
instance structure for two-dimensional point More...
#include <point2.h>
Public Member Functions | |
| void | val (a_real &x_, a_real &y_) const |
| get the cartesian coordinates of a 2D point. | |
| void | set_val (a_real x_, a_real y_) |
| set the cartesian coordinates of a 2D point. | |
| void | pol (a_real &rho, a_real &theta) const |
| get the polar coordinates of a 2D point. | |
| void | set_pol (a_real rho, a_real theta) |
| set the polar coordinates of a 2D point. | |
| void | add (a_vector2 const &rhs, a_point2 &res) const |
| add a 2D vector to a 2D point. | |
| void | sub (a_vector2 const &rhs, a_point2 &res) const |
| subtract a 2D vector from a 2D point. | |
| void | mul (a_real rhs, a_point2 &res) const |
| multiplie a 2D point by a scalar. | |
| void | div (a_real rhs, a_point2 &res) const |
| divide a 2D point by a scalar. | |
| void | pos (a_vector2 &res) const |
| convert it into a vector from the origin to the point. | |
| void | neg (a_vector2 &res) const |
| convert it into a vector from the point to the origin. | |
| a_real | dist (a_point2 const &rhs) const |
| compute the distance between two 2D points. | |
| a_real | dist2 (a_point2 const &rhs) const |
| compute the squared distance between two 2D points. | |
| a_real | mindist (a_point2 const *i_p, a_size i_n, a_point2 *o_p=NULL, a_size *o_i=NULL) const |
| compute the minimum distance from a reference point to a point set. | |
| a_real | maxdist (a_point2 const *i_p, a_size i_n, a_point2 *o_p=NULL, a_size *o_i=NULL) const |
| compute the maximum distance from a reference point to a point set. | |
Data Fields | |
| a_real | x |
| a_real | y |
Friends | |
| void | operator+= (a_point2 &lhs, a_vector2 const &rhs) |
| add a 2D vector to a 2D point. | |
| a_point2 | operator+ (a_point2 const &lhs, a_vector2 const &rhs) |
| add a 2D vector to a 2D point. | |
| void | operator-= (a_point2 &lhs, a_vector2 const &rhs) |
| subtract a 2D vector from a 2D point. | |
| a_point2 | operator- (a_point2 const &lhs, a_vector2 const &rhs) |
| subtract a 2D vector from a 2D point. | |
| a_vector2 | operator- (a_point2 const &lhs, a_point2 const &rhs) |
| set a 2D vector as the difference from point p to point q. | |
| void | operator*= (a_point2 &lhs, a_real rhs) |
| multiplie a 2D point by a scalar. | |
| a_point2 | operator* (a_real lhs, a_point2 const &rhs) |
| multiplie a 2D point by a scalar. | |
| a_point2 | operator* (a_point2 const &lhs, a_real rhs) |
| multiplie a 2D point by a scalar. | |
| void | operator/= (a_point2 &lhs, a_real rhs) |
| divide a 2D point by a scalar. | |
| a_point2 | operator/ (a_point2 const &lhs, a_real rhs) |
| divide a 2D point by a scalar. | |
| a_vector2 | operator+ (a_point2 const &rhs) |
| convert it into a vector from the origin to the point. | |
| a_vector2 | operator- (a_point2 const &rhs) |
| convert it into a vector from the point to the origin. | |
instance structure for two-dimensional point
add a 2D vector to a 2D point.
compute the distance between two 2D points.
compute the squared distance between two 2D points.
divide a 2D point by a scalar.
|
inline |
compute the maximum distance from a reference point to a point set.
|
inline |
compute the minimum distance from a reference point to a point set.
multiplie a 2D point by a scalar.
|
inline |
convert it into a vector from the point to the origin.
get the polar coordinates of a 2D point.
|
inline |
convert it into a vector from the origin to the point.
set the polar coordinates of a 2D point.
set the cartesian coordinates of a 2D point.
subtract a 2D vector from a 2D point.
get the cartesian coordinates of a 2D point.
multiplie a 2D point by a scalar.
multiplie a 2D point by a scalar.
multiplie a 2D point by a scalar.
add a 2D vector to a 2D point.
convert it into a vector from the origin to the point.
add a 2D vector to a 2D point.
set a 2D vector as the difference from point p to point q.
subtract a 2D vector from a 2D point.
convert it into a vector from the point to the origin.
subtract a 2D vector from a 2D point.
divide a 2D point by a scalar.
divide a 2D point by a scalar.