|
liba 0.1.15
An algorithm library based on C/C++
|
instance structure for two-dimensional line defined by an origin, a direction vector, and a length More...
#include <line2.h>
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) |
| set the origin coordinates of the line. | |
| a_vector2 const & | dir () const |
| get the address of the direction vector of the line. | |
| int | set_dir (a_real x, a_real y) |
| set the direction vector and length of the line using raw components. | |
| void | tgt (a_point2 &res) const |
| compute the target endpoint of the line segment. | |
| int | set_tgt (a_real x, a_real y) |
| Set the line direction and length based on a target point relative to the current origin. | |
| int | set (a_point2 const &p, a_vector2 const &v) |
| initialize the line segment from a start point and a direction vector. | |
| int | set (a_point2 const &p, a_point2 const &q) |
| initialize the line segment from two points (start point p, end point q). | |
| void | eval (a_real w, a_point2 &res) const |
| evaluate a point on the line at a given parameter. | |
| a_real | parm (a_point2 const &rhs) const |
| compute the scalar projection parameter of a point onto the infinite line. | |
| a_real | proj (a_point2 const &rhs, a_point2 &res) const |
| project a point onto the infinite line. | |
| a_real | limparm (a_real min_, a_real max_, a_point2 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_point2 const &rhs, a_point2 &res) const |
| project a point onto a line segment. | |
| a_real | sdist (a_point2 const &rhs) const |
| compute the signed distance from a point to the infinite line. | |
| a_real | dist (a_point2 const &rhs) const |
| compute the absolute distance from a point to the infinite line. | |
| a_real | limdist (a_real min_, a_real max_, a_point2 const &rhs, a_real &w, a_point2 &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_point2 const &rhs, a_real &w, a_point2 &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_line2 const &rhs, a_real min2, a_real max2, a_real &w1, a_point2 &p1, a_real &w2, a_point2 &p2) const |
| compute the distance between two line segments. | |
| a_real | segdist2 (a_real min1, a_real max1, a_line2 const &rhs, a_real min2, a_real max2, a_real &w1, a_point2 &p1, a_real &w2, a_point2 &p2) const |
| compute the squared distance between two line segments. | |
| int | int0 (a_real min_, a_real max_, a_point2 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_line2 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_point2 const &rhs, a_real sin, a_real cos, a_line2 &res) const |
| rotate a line segment around a pivot point using pre-calculated sine and cosine values. | |
| void | rot (a_point2 const &rhs, a_real angle, a_line2 &res) const |
| rotate a line segment around a specified pivot point. | |
Data Fields | |
| a_point2 | org |
| a_vector2 | dir_ |
| a_real | max |
instance structure for two-dimensional line defined by an origin, a direction vector, and a length
|
inline |
get the address of the direction vector of the line.
compute the absolute distance from a point to the infinite line.
evaluate a point on the line at a given parameter.
compute the intersection between a point and a line segment.
|
inline |
compute the intersection between two line segments.
|
inline |
compute the distance from a point to the closest point on a line segment.
|
inline |
compute the squared distance from a point to the closest point on a line segment.
compute the scalar projection parameter of a point onto the line segment.
|
inline |
project a point onto a line segment.
compute the scalar projection parameter of a point onto the infinite line.
project a point onto the infinite line.
rotate a line segment around a specified pivot point.
rotate a line segment around a pivot point using pre-calculated sine and cosine values.
compute the signed distance from a point to the infinite line.
|
inline |
compute the distance between two line segments.
|
inline |
compute the squared distance between two line segments.
initialize the line segment from two points (start point p, end point q).
initialize the line segment from a start point and a direction vector.
set the direction vector and length of the line using raw components.
|
inline |
set the maximum length of the line segment.
set the origin coordinates of the line.
Set the line direction and length based on a target point relative to the current origin.
|
inline |
compute the target endpoint of the line segment.
| a_vector2 a_line2::dir_ |
normalized direction vector of the line
| a_real a_line2::max |
maximum length of the line segment
| a_point2 a_line2::org |
origin point of the line