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

instance structure for three-dimensional line defined by an origin, a direction vector, and a length More...

#include <line3.h>

Collaboration diagram for a_line3:
[legend]

Public Member Functions

void set_max (a_real max_)
 set the maximum length of the line segment.
void set_org (a_real x, a_real y, a_real z)
 set the origin coordinates of the line.
a_vector3 const & dir () const
 get the address of the direction vector of the line.
int set_dir (a_real x, a_real y, a_real z)
 set the direction vector and length of the line using raw components.
void tgt (a_point3 &res) const
 compute the target endpoint of the line segment.
int set_tgt (a_real x, a_real y, a_real z)
 Set the line direction and length based on a target point relative to the current origin.
int set (a_point3 const &p, a_vector3 const &v)
 initialize the line segment from a start point and a direction vector.
int set (a_point3 const &p, a_point3 const &q)
 initialize the line segment from two points (start point p, end point q).
void eval (a_real w, a_point3 &res) const
 evaluate a point on the line at a given parameter.
a_real parm (a_point3 const &rhs) const
 compute the scalar projection parameter of a point onto the infinite line.
a_real proj (a_point3 const &rhs, a_point3 &res) const
 project a point onto the infinite line.
a_real limparm (a_real min_, a_real max_, a_point3 const &rhs) const
 compute the scalar projection parameter of a point onto the line segment.
a_real limproj (a_real min_, a_real max_, a_point3 const &rhs, a_point3 &res) const
 project a point onto a line segment.
a_real dist (a_point3 const &rhs) const
 compute the distance from a point to the infinite line.
a_real dist2 (a_point3 const &rhs) const
 compute the squared distance from a point to the infinite line.
a_real limdist (a_real min_, a_real max_, a_point3 const &rhs, a_real &w, a_point3 &p)
 compute the distance from a point to the closest point on a line segment.
a_real limdist2 (a_real min_, a_real max_, a_point3 const &rhs, a_real &w, a_point3 &p)
 compute the squared distance from a point to the closest point on a line segment.
a_real segdist (a_real min1, a_real max1, a_line3 const &rhs, a_real min2, a_real max2, a_real &w1, a_point3 &p1, a_real &w2, a_point3 &p2) const
 compute the distance between two line segments.
a_real segdist2 (a_real min1, a_real max1, a_line3 const &rhs, a_real min2, a_real max2, a_real &w1, a_point3 &p1, a_real &w2, a_point3 &p2) const
 compute the squared distance between two line segments.
int int0 (a_real min_, a_real max_, a_point3 const &rhs, a_real &w) const
 compute the intersection between a point and a line segment.
int int1 (a_real min1, a_real max1, a_line3 const &rhs, a_real min2, a_real max2, a_real &w1, a_real &w2) const
 compute the intersection between two line segments.
void rot (a_line3 const &rhs, a_real sin, a_real cos, a_line3 &res) const
 rotate a 3D line segment around an arbitrary axis defined by another line.
void rot (a_line3 const &rhs, a_real angle, a_line3 &res) const
 rotate a 3D line segment around an arbitrary axis defined by another line.

Data Fields

a_point3 org
a_vector3 dir_
a_real max

Detailed Description

instance structure for three-dimensional line defined by an origin, a direction vector, and a length

Member Function Documentation

◆ dir()

a_vector3 const & a_line3::dir ( ) const
inline

get the address of the direction vector of the line.

See also
a_line3_dir

◆ dist()

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

compute the distance from a point to the infinite line.

See also
a_line3_dist

◆ dist2()

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

compute the squared distance from a point to the infinite line.

See also
a_line3_dist2

◆ eval()

void a_line3::eval ( a_real w,
a_point3 & res ) const
inline

evaluate a point on the line at a given parameter.

See also
a_line3_eval

◆ int0()

int a_line3::int0 ( a_real min_,
a_real max_,
a_point3 const & rhs,
a_real & w ) const
inline

compute the intersection between a point and a line segment.

See also
a_line3_int0

◆ int1()

int a_line3::int1 ( a_real min1,
a_real max1,
a_line3 const & rhs,
a_real min2,
a_real max2,
a_real & w1,
a_real & w2 ) const
inline

compute the intersection between two line segments.

See also
a_line3_int1

◆ limdist()

a_real a_line3::limdist ( a_real min_,
a_real max_,
a_point3 const & rhs,
a_real & w,
a_point3 & p )
inline

compute the distance from a point to the closest point on a line segment.

See also
a_line3_limdist

◆ limdist2()

a_real a_line3::limdist2 ( a_real min_,
a_real max_,
a_point3 const & rhs,
a_real & w,
a_point3 & p )
inline

compute the squared distance from a point to the closest point on a line segment.

See also
a_line3_limdist2

◆ limparm()

a_real a_line3::limparm ( a_real min_,
a_real max_,
a_point3 const & rhs ) const
inline

compute the scalar projection parameter of a point onto the line segment.

See also
a_line3_limparm

◆ limproj()

a_real a_line3::limproj ( a_real min_,
a_real max_,
a_point3 const & rhs,
a_point3 & res ) const
inline

project a point onto a line segment.

See also
a_line3_limproj

◆ parm()

a_real a_line3::parm ( a_point3 const & rhs) const
inline

compute the scalar projection parameter of a point onto the infinite line.

See also
a_line3_parm

◆ proj()

a_real a_line3::proj ( a_point3 const & rhs,
a_point3 & res ) const
inline

project a point onto the infinite line.

See also
a_line3_proj

◆ rot() [1/2]

void a_line3::rot ( a_line3 const & rhs,
a_real angle,
a_line3 & res ) const
inline

rotate a 3D line segment around an arbitrary axis defined by another line.

See also
a_line3_rot

◆ rot() [2/2]

void a_line3::rot ( a_line3 const & rhs,
a_real sin,
a_real cos,
a_line3 & res ) const
inline

rotate a 3D line segment around an arbitrary axis defined by another line.

See also
a_line3_rot_

◆ segdist()

a_real a_line3::segdist ( a_real min1,
a_real max1,
a_line3 const & rhs,
a_real min2,
a_real max2,
a_real & w1,
a_point3 & p1,
a_real & w2,
a_point3 & p2 ) const
inline

compute the distance between two line segments.

See also
a_line3_segdist

◆ segdist2()

a_real a_line3::segdist2 ( a_real min1,
a_real max1,
a_line3 const & rhs,
a_real min2,
a_real max2,
a_real & w1,
a_point3 & p1,
a_real & w2,
a_point3 & p2 ) const
inline

compute the squared distance between two line segments.

See also
a_line3_segdist2

◆ set() [1/2]

int a_line3::set ( a_point3 const & p,
a_point3 const & q )
inline

initialize the line segment from two points (start point p, end point q).

See also
a_line3_set

◆ set() [2/2]

int a_line3::set ( a_point3 const & p,
a_vector3 const & v )
inline

initialize the line segment from a start point and a direction vector.

See also
a_line3_setv

◆ set_dir()

int a_line3::set_dir ( a_real x,
a_real y,
a_real z )
inline

set the direction vector and length of the line using raw components.

See also
a_line3_set_dir

◆ set_max()

void a_line3::set_max ( a_real max_)
inline

set the maximum length of the line segment.

See also
a_line3_set_max

◆ set_org()

void a_line3::set_org ( a_real x,
a_real y,
a_real z )
inline

set the origin coordinates of the line.

See also
a_line3_set_org

◆ set_tgt()

int a_line3::set_tgt ( a_real x,
a_real y,
a_real z )
inline

Set the line direction and length based on a target point relative to the current origin.

See also
a_line3_set_tgt

◆ tgt()

void a_line3::tgt ( a_point3 & res) const
inline

compute the target endpoint of the line segment.

See also
a_line3_tgt

Field Documentation

◆ dir_

a_vector3 a_line3::dir_

normalized direction vector of the line

◆ max

a_real a_line3::max

maximum length of the line segment

◆ org

a_point3 a_line3::org

origin point of the line


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