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

instance structure for three-dimensional point More...

#include <point3.h>

Public Member Functions

void val (a_real &x_, a_real &y_, a_real &z_) const
 get the cartesian coordinates of a 3D point.
void set_val (a_real x_, a_real y_, a_real z_)
 set the cartesian coordinates of a 3D point.
void cyl (a_real &rho, a_real &theta, a_real &z_) const
 get the cylindrical coordinates of a 3D point.
void set_cyl (a_real rho, a_real theta, a_real z_)
 set the cylindrical coordinates of a 3D point.
void sph (a_real &rho, a_real &theta, a_real &alpha) const
 get the spherical coordinates of a 3D point.
void set_sph (a_real rho, a_real theta, a_real alpha)
 set the spherical coordinates of a 3D point.
void add (a_vector3 const &rhs, a_point3 &res) const
 add a 3D vector to a 3D point.
void sub (a_vector3 const &rhs, a_point3 &res) const
 subtract a 3D vector from a 3D point.
void mul (a_real rhs, a_point3 &res) const
 multiplie a 3D point by a scalar.
void div (a_real rhs, a_point3 &res) const
 divide a 3D point by a scalar.
void pos (a_vector3 &res) const
 convert it into a vector from the origin to the point.
void neg (a_vector3 &res) const
 convert it into a vector from the point to the origin.
a_real dist (a_point3 const &rhs) const
 compute the distance between two 3D points.
a_real dist2 (a_point3 const &rhs) const
 compute the squared distance between two 3D points.
a_real mindist (a_point3 const *i_p, a_size i_n, a_point3 *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_point3 const *i_p, a_size i_n, a_point3 *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
a_real z

Friends

void operator+= (a_point3 &lhs, a_vector3 const &rhs)
 add a 3D vector to a 3D point.
a_point3 operator+ (a_point3 const &lhs, a_vector3 const &rhs)
 add a 3D vector to a 3D point.
void operator-= (a_point3 &lhs, a_vector3 const &rhs)
 subtract a 3D vector from a 3D point.
a_point3 operator- (a_point3 const &lhs, a_vector3 const &rhs)
 subtract a 3D vector from a 3D point.
a_vector3 operator- (a_point3 const &lhs, a_point3 const &rhs)
 set a 3D vector as the difference from point p to point q.
void operator*= (a_point3 &lhs, a_real rhs)
 multiplie a 3D point by a scalar.
a_point3 operator* (a_real lhs, a_point3 const &rhs)
 multiplie a 3D point by a scalar.
a_point3 operator* (a_point3 const &lhs, a_real rhs)
 multiplie a 3D point by a scalar.
void operator/= (a_point3 &lhs, a_real rhs)
 divide a 3D point by a scalar.
a_point3 operator/ (a_point3 const &lhs, a_real rhs)
 divide a 3D point by a scalar.
a_vector3 operator+ (a_point3 const &rhs)
 convert it into a vector from the origin to the point.
a_vector3 operator- (a_point3 const &rhs)
 convert it into a vector from the point to the origin.

Detailed Description

instance structure for three-dimensional point

Member Function Documentation

◆ add()

void a_point3::add ( a_vector3 const & rhs,
a_point3 & res ) const
inline

add a 3D vector to a 3D point.

See also
a_point3_add

◆ cyl()

void a_point3::cyl ( a_real & rho,
a_real & theta,
a_real & z_ ) const
inline

get the cylindrical coordinates of a 3D point.

See also
a_point3_cyl

◆ dist()

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

compute the distance between two 3D points.

See also
a_point3_dist

◆ dist2()

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

compute the squared distance between two 3D points.

See also
a_point3_dist2

◆ div()

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

divide a 3D point by a scalar.

See also
a_point3_div

◆ maxdist()

a_real a_point3::maxdist ( a_point3 const * i_p,
a_size i_n,
a_point3 * 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_point3_maxdist

◆ mindist()

a_real a_point3::mindist ( a_point3 const * i_p,
a_size i_n,
a_point3 * 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_point3_mindist

◆ mul()

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

multiplie a 3D point by a scalar.

See also
a_point3_mul

◆ neg()

void a_point3::neg ( a_vector3 & res) const
inline

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

See also
a_point3_neg

◆ pos()

void a_point3::pos ( a_vector3 & res) const
inline

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

See also
a_point3_pos

◆ set_cyl()

void a_point3::set_cyl ( a_real rho,
a_real theta,
a_real z_ )
inline

set the cylindrical coordinates of a 3D point.

See also
a_point3_set_cyl

◆ set_sph()

void a_point3::set_sph ( a_real rho,
a_real theta,
a_real alpha )
inline

set the spherical coordinates of a 3D point.

See also
a_point3_set_sph

◆ set_val()

void a_point3::set_val ( a_real x_,
a_real y_,
a_real z_ )
inline

set the cartesian coordinates of a 3D point.

See also
a_point3_set_val

◆ sph()

void a_point3::sph ( a_real & rho,
a_real & theta,
a_real & alpha ) const
inline

get the spherical coordinates of a 3D point.

See also
a_point3_sph

◆ sub()

void a_point3::sub ( a_vector3 const & rhs,
a_point3 & res ) const
inline

subtract a 3D vector from a 3D point.

See also
a_point3_sub

◆ val()

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

get the cartesian coordinates of a 3D point.

See also
a_point3_val

◆ operator* [1/2]

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

multiplie a 3D point by a scalar.

See also
a_point3_mul

◆ operator* [2/2]

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

multiplie a 3D point by a scalar.

See also
a_point3_mul

◆ operator*=

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

multiplie a 3D point by a scalar.

See also
a_point3_mul

◆ operator+ [1/2]

a_point3 operator+ ( a_point3 const & lhs,
a_vector3 const & rhs )
friend

add a 3D vector to a 3D point.

See also
a_point3_add

◆ operator+ [2/2]

a_vector3 operator+ ( a_point3 const & rhs)
friend

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

See also
a_point3_pos

◆ operator+=

void operator+= ( a_point3 & lhs,
a_vector3 const & rhs )
friend

add a 3D vector to a 3D point.

See also
a_point3_add

◆ operator- [1/3]

a_vector3 operator- ( a_point3 const & lhs,
a_point3 const & rhs )
friend

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

See also
a_vector3_set

◆ operator- [2/3]

a_point3 operator- ( a_point3 const & lhs,
a_vector3 const & rhs )
friend

subtract a 3D vector from a 3D point.

See also
a_point3_sub

◆ operator- [3/3]

a_vector3 operator- ( a_point3 const & rhs)
friend

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

See also
a_point3_neg

◆ operator-=

void operator-= ( a_point3 & lhs,
a_vector3 const & rhs )
friend

subtract a 3D vector from a 3D point.

See also
a_point3_sub

◆ operator/

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

divide a 3D point by a scalar.

See also
a_point3_div

◆ operator/=

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

divide a 3D point by a scalar.

See also
a_point3_div

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