liba 0.1.15
An algorithm library based on C/C++
Loading...
Searching...
No Matches
a_point2 Struct Reference

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.

Detailed Description

instance structure for two-dimensional point

Member Function Documentation

◆ add()

void a_point2::add ( a_vector2 const & rhs,
a_point2 & res ) const
inline

add a 2D vector to a 2D point.

See also
a_point2_add

◆ dist()

a_real a_point2::dist ( a_point2 const & rhs) const
inline

compute the distance between two 2D points.

See also
a_point2_dist

◆ dist2()

a_real a_point2::dist2 ( a_point2 const & rhs) const
inline

compute the squared distance between two 2D points.

See also
a_point2_dist2

◆ div()

void a_point2::div ( a_real rhs,
a_point2 & res ) const
inline

divide a 2D point by a scalar.

See also
a_point2_div

◆ maxdist()

a_real a_point2::maxdist ( a_point2 const * i_p,
a_size i_n,
a_point2 * o_p = NULL,
a_size * o_i = NULL ) const
inline

compute the maximum distance from a reference point to a point set.

See also
a_point2_maxdist

◆ mindist()

a_real a_point2::mindist ( a_point2 const * i_p,
a_size i_n,
a_point2 * o_p = NULL,
a_size * o_i = NULL ) const
inline

compute the minimum distance from a reference point to a point set.

See also
a_point2_mindist

◆ mul()

void a_point2::mul ( a_real rhs,
a_point2 & res ) const
inline

multiplie a 2D point by a scalar.

See also
a_point2_mul

◆ neg()

void a_point2::neg ( a_vector2 & res) const
inline

convert it into a vector from the point to the origin.

See also
a_point2_neg

◆ pol()

void a_point2::pol ( a_real & rho,
a_real & theta ) const
inline

get the polar coordinates of a 2D point.

See also
a_point2_pol

◆ pos()

void a_point2::pos ( a_vector2 & res) const
inline

convert it into a vector from the origin to the point.

See also
a_point2_pos

◆ set_pol()

void a_point2::set_pol ( a_real rho,
a_real theta )
inline

set the polar coordinates of a 2D point.

See also
a_point2_set_pol

◆ set_val()

void a_point2::set_val ( a_real x_,
a_real y_ )
inline

set the cartesian coordinates of a 2D point.

See also
a_point2_set_val

◆ sub()

void a_point2::sub ( a_vector2 const & rhs,
a_point2 & res ) const
inline

subtract a 2D vector from a 2D point.

See also
a_point2_sub

◆ val()

void a_point2::val ( a_real & x_,
a_real & y_ ) const
inline

get the cartesian coordinates of a 2D point.

See also
a_point2_val

◆ operator* [1/2]

a_point2 operator* ( a_point2 const & lhs,
a_real rhs )
friend

multiplie a 2D point by a scalar.

See also
a_point2_mul

◆ operator* [2/2]

a_point2 operator* ( a_real lhs,
a_point2 const & rhs )
friend

multiplie a 2D point by a scalar.

See also
a_point2_mul

◆ operator*=

void operator*= ( a_point2 & lhs,
a_real rhs )
friend

multiplie a 2D point by a scalar.

See also
a_point2_mul

◆ operator+ [1/2]

a_point2 operator+ ( a_point2 const & lhs,
a_vector2 const & rhs )
friend

add a 2D vector to a 2D point.

See also
a_point2_add

◆ operator+ [2/2]

a_vector2 operator+ ( a_point2 const & rhs)
friend

convert it into a vector from the origin to the point.

See also
a_point2_pos

◆ operator+=

void operator+= ( a_point2 & lhs,
a_vector2 const & rhs )
friend

add a 2D vector to a 2D point.

See also
a_point2_add

◆ operator- [1/3]

a_vector2 operator- ( a_point2 const & lhs,
a_point2 const & rhs )
friend

set a 2D vector as the difference from point p to point q.

See also
a_vector2_set

◆ operator- [2/3]

a_point2 operator- ( a_point2 const & lhs,
a_vector2 const & rhs )
friend

subtract a 2D vector from a 2D point.

See also
a_point2_sub

◆ operator- [3/3]

a_vector2 operator- ( a_point2 const & rhs)
friend

convert it into a vector from the point to the origin.

See also
a_point2_neg

◆ operator-=

void operator-= ( a_point2 & lhs,
a_vector2 const & rhs )
friend

subtract a 2D vector from a 2D point.

See also
a_point2_sub

◆ operator/

a_point2 operator/ ( a_point2 const & lhs,
a_real rhs )
friend

divide a 2D point by a scalar.

See also
a_point2_div

◆ operator/=

void operator/= ( a_point2 & lhs,
a_real rhs )
friend

divide a 2D point by a scalar.

See also
a_point2_div

The documentation for this struct was generated from the following file: