liba 0.1.15
An algorithm library based on C/C++
Loading...
Searching...
No Matches
line3.h File Reference

three-dimensional line More...

#include "a.h"
#include "point3.h"
Include dependency graph for line3.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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
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.

Detailed Description

three-dimensional line