|
liba 0.1.15
An algorithm library based on C/C++
|
Data Structures | |
| struct | a_line3 |
| instance structure for three-dimensional line defined by an origin, a direction vector, and a length More... | |
Macros | |
| #define | a_line3_c(x) |
| #define | a_line3_(_, x) |
Typedefs | |
| typedef struct a_line3 | a_line3 |
Functions | |
| a_real | a_line3_max (a_line3 const *ctx) |
| get the maximum length of the line segment. | |
| a_point3 const * | a_line3_org (a_line3 const *ctx) |
| get the address of the origin point of the line. | |
| a_vector3 const * | a_line3_dir (a_line3 const *ctx) |
| get the address of the direction vector of the line. | |
| void | a_line3_tgt (a_line3 const *ctx, a_point3 *res) |
| compute the target endpoint of the line segment. | |
| void | a_line3_set_org (a_line3 *ctx, a_real x, a_real y, a_real z) |
| set the origin coordinates of the line. | |
| void | a_line3_set_max (a_line3 *ctx, a_real max) |
| set the maximum length of the line segment. | |
| int | a_line3_set_dir (a_line3 *ctx, a_real x, a_real y, a_real z) |
| set the direction vector and length of the line using raw components. | |
| int | a_line3_set_tgt (a_line3 *ctx, 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 | a_line3_setv (a_line3 *ctx, a_point3 const *p, a_vector3 const *v) |
| initialize the line segment from a start point and a direction vector. | |
| int | a_line3_set (a_line3 *ctx, a_point3 const *p, a_point3 const *q) |
| initialize the line segment from two points (start point p, end point q). | |
| void | a_line3_eval (a_line3 const *ctx, a_real w, a_point3 *res) |
| evaluate a point on the line at a given parameter. | |
| a_real | a_line3_parm (a_line3 const *ctx, a_point3 const *rhs) |
| compute the scalar projection parameter of a point onto the infinite line. | |
| a_real | a_line3_proj (a_line3 const *ctx, a_point3 const *rhs, a_point3 *res) |
| project a point onto the infinite line. | |
| a_real | a_line3_limparm (a_line3 const *ctx, a_real min, a_real max, a_point3 const *rhs) |
| compute the scalar projection parameter of a point onto the line segment. | |
| a_real | a_line3_limproj (a_line3 const *ctx, a_real min, a_real max, a_point3 const *rhs, a_point3 *res) |
| project a point onto a line segment. | |
| a_real | a_line3_dist (a_line3 const *ctx, a_point3 const *rhs) |
| compute the distance from a point to the infinite line. | |
| a_real | a_line3_dist2 (a_line3 const *ctx, a_point3 const *rhs) |
| compute the squared distance from a point to the infinite line. | |
| a_real | a_line3_limdist (a_line3 const *ctx, 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 | a_line3_limdist2 (a_line3 const *ctx, 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 | a_line3_segdist (a_line3 const *ctx, 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) |
| compute the distance between two line segments. | |
| a_real | a_line3_segdist2 (a_line3 const *ctx, 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) |
| compute the squared distance between two line segments. | |
| int | a_line3_int0 (a_line3 const *ctx, a_real min, a_real max, a_point3 const *rhs, a_real *w) |
| compute the intersection between a point and a line segment. | |
| int | a_line3_int1 (a_line3 const *ctx, a_real min1, a_real max1, a_line3 const *rhs, a_real min2, a_real max2, a_real *w1, a_real *w2) |
| compute the intersection between two line segments. | |
| void | a_line3_rot_ (a_line3 const *ctx, a_line3 const *rhs, a_real sin, a_real cos, a_line3 *res) |
| rotate a 3D line segment around an arbitrary axis defined by another line. | |
| void | a_line3_rot (a_line3 const *ctx, a_line3 const *rhs, a_real angle, a_line3 *res) |
| rotate a 3D line segment around an arbitrary axis defined by another line. | |
| #define a_line3_ | ( | _, | |
| x ) |
| #define a_line3_c | ( | x | ) |
static cast to three-dimensional line defined by an origin, a direction vector, and a length
get the address of the direction vector of the line.
| [in] | ctx | points to an instance of the three-dimensional line |
compute the distance from a point to the infinite line.
| [in] | ctx | points to an instance of the three-dimensional line |
| [in] | rhs | points to the point |
compute the squared distance from a point to the infinite line.
| [in] | ctx | points to an instance of the three-dimensional line |
| [in] | rhs | points to the point |
evaluate a point on the line at a given parameter.
| [in] | ctx | points to an instance of the three-dimensional line |
| [in] | w | is the scalar parameter |
| [out] | res | stores the result |
compute the intersection between a point and a line segment.
| [in] | ctx | points to an instance of the line segment |
| [in] | min | is the lower bound of the line segment |
| [in] | max | is the upper bound of the line segment |
| [in] | rhs | points to the point to intersect |
| [out] | w | stores the parameter on the segment |
| 1 | intersection found |
| 0 | no intersection |
| int a_line3_int1 | ( | a_line3 const * | ctx, |
| a_real | min1, | ||
| a_real | max1, | ||
| a_line3 const * | rhs, | ||
| a_real | min2, | ||
| a_real | max2, | ||
| a_real * | w1, | ||
| a_real * | w2 ) |
compute the intersection between two line segments.
| [in] | ctx | points to an instance of the first line segment |
| [in] | min1 | is the lower bound of the first line segment |
| [in] | max1 | is the upper bound of the first line segment |
| [in] | rhs | points to an instance of the second line segment |
| [in] | min2 | is the lower bound of the second line segment |
| [in] | max2 | is the upper bound of the second line segment |
| [out] | w1 | stores parameter of the point on the first segment or the start point on the first segment |
| [out] | w2 | stores parameter of the point on the second segment or the end point on the first segment |
| 2 | intersection is a segment, the start point and the end point on the first segment |
| 1 | intersection is a point, the point on the first segment and the second segment |
| 0 | no intersection |
| a_real a_line3_limdist | ( | a_line3 const * | ctx, |
| 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.
| [in] | ctx | points to an instance of the line segment |
| [in] | min | is the lower bound of the line segment |
| [in] | max | is the upper bound of the line segment |
| [in] | rhs | points to the point |
| [out] | w | stores the parameter of the closest point |
| [out] | p | stores the coordinates of the closest point |
| a_real a_line3_limdist2 | ( | a_line3 const * | ctx, |
| 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.
| [in] | ctx | points to an instance of the line segment |
| [in] | min | is the lower bound of the line segment |
| [in] | max | is the upper bound of the line segment |
| [in] | rhs | points to the point |
| [out] | w | stores the parameter of the closest point |
| [out] | p | stores the coordinates of the closest point |
compute the scalar projection parameter of a point onto the line segment.
| [in] | ctx | points to an instance of the line segment |
| [in] | min | is the lower bound of the line segment |
| [in] | max | is the upper bound of the line segment |
| [in] | rhs | points to the point to project |
| a_real a_line3_limproj | ( | a_line3 const * | ctx, |
| a_real | min, | ||
| a_real | max, | ||
| a_point3 const * | rhs, | ||
| a_point3 * | res ) |
project a point onto a line segment.
| [in] | ctx | points to an instance of the line segment |
| [in] | min | is the lower bound of the line segment |
| [in] | max | is the upper bound of the line segment |
| [in] | rhs | points to the point to project |
| [in] | res | stores the projection result |
get the maximum length of the line segment.
| [in] | ctx | points to an instance of the three-dimensional line |
get the address of the origin point of the line.
| [in] | ctx | points to an instance of the three-dimensional line |
compute the scalar projection parameter of a point onto the infinite line.
| [in] | ctx | points to an instance of the three-dimensional line |
| [in] | rhs | points to the point to project |
project a point onto the infinite line.
| [in] | ctx | points to an instance of the three-dimensional line |
| [in] | rhs | points to the point to project |
| [in] | res | stores the projection result |
rotate a 3D line segment around an arbitrary axis defined by another line.
| [in] | ctx | points to an instance of the line segment |
| [in] | rhs | points to the line defining the rotation axis and pivot point |
| [in] | angle | is rotation angle in radians |
| [out] | res | stores the result line segment |
| void a_line3_rot_ | ( | a_line3 const * | ctx, |
| a_line3 const * | rhs, | ||
| a_real | sin, | ||
| a_real | cos, | ||
| a_line3 * | res ) |
rotate a 3D line segment around an arbitrary axis defined by another line.
| [in] | ctx | points to an instance of the line segment |
| [in] | rhs | points to the line defining the rotation axis and pivot point |
| [in] | sin | is precomputed \(\sin(\theta)\) |
| [in] | cos | is precomputed \(\cos(\theta)\) |
| [out] | res | stores the result line segment |
| a_real a_line3_segdist | ( | a_line3 const * | ctx, |
| 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 ) |
compute the distance between two line segments.
| [in] | ctx | points to an instance of the first line segment |
| [in] | min1 | is the lower bound of the first line segment |
| [in] | max1 | is the upper bound of the first line segment |
| [in] | rhs | points to an instance of the second line segment |
| [in] | min2 | is the lower bound of the second line segment |
| [in] | max2 | is the upper bound of the second line segment |
| [out] | w1 | stores parameter of the closest point on the first segment |
| [out] | p1 | stores coordinates of the closest point on the first segment |
| [out] | w2 | stores parameter of the closest point on the second segment |
| [out] | p2 | stores coordinates of the closest point on the second segment |
| a_real a_line3_segdist2 | ( | a_line3 const * | ctx, |
| 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 ) |
compute the squared distance between two line segments.
| [in] | ctx | points to an instance of the first line segment |
| [in] | min1 | is the lower bound of the first line segment |
| [in] | max1 | is the upper bound of the first line segment |
| [in] | rhs | points to an instance of the second line segment |
| [in] | min2 | is the lower bound of the second line segment |
| [in] | max2 | is the upper bound of the second line segment |
| [out] | w1 | stores parameter of the closest point on the first segment |
| [out] | p1 | stores coordinates of the closest point on the first segment |
| [out] | w2 | stores parameter of the closest point on the second segment |
| [out] | p2 | stores coordinates of the closest point on the second segment |
initialize the line segment from two points (start point p, end point q).
| [in,out] | ctx | points to an instance of the three-dimensional line |
| [in] | p | points to the start point (origin) |
| [in] | q | points to the end point (target) |
| <0 | failure |
| 0 | success |
set the direction vector and length of the line using raw components.
| [in,out] | ctx | points to an instance of the three-dimensional line |
| [in] | x | is X component of the direction vector |
| [in] | y | is Y component of the direction vector |
| [in] | z | is Z component of the direction vector |
| <0 | failure |
| 0 | success |
set the maximum length of the line segment.
| [in,out] | ctx | points to an instance of the three-dimensional line |
| [in] | max | is the maximum length |
set the origin coordinates of the line.
| [in,out] | ctx | points to an instance of the three-dimensional line |
| [in] | x | is the x-coordinate of the origin |
| [in] | y | is the y-coordinate of the origin |
| [in] | z | is the z-coordinate of the origin |
Set the line direction and length based on a target point relative to the current origin.
| [in,out] | ctx | points to an instance of the three-dimensional line |
| [in] | x | is X coordinate of the target point |
| [in] | y | is Y coordinate of the target point |
| [in] | z | is Z coordinate of the target point |
| <0 | failure |
| 0 | success |
initialize the line segment from a start point and a direction vector.
| [in,out] | ctx | points to an instance of the three-dimensional line |
| [in] | p | points to the start point (origin) |
| [in] | v | points to the direction vector (defines direction and length) |
| <0 | failure |
| 0 | success |