#include <geom.hh>
Public Member Functions | |
Line () | |
Create a line. | |
Line (Point a, Point b) | |
Create a line. | |
Line (float x1, float y1, float x2, float y2) | |
Create a line. | |
Line (const LineRT &line) | |
Create a line by converting from the polar representation (rho, theta). | |
void | add (Point p, float scale=1) |
Add a point to the end points of the line. | |
float | length () const |
Compute the length of the line. | |
Point | normal () const |
Compute the normal of the line. | |
Point | tangent () const |
Compute the tangent of the line. | |
Point | intersection (const Line &line) const |
Compute the intersection with line . | |
Line & | cut (const Line &line1, const Line &line2) |
Cut the line between two lines. | |
Line | get_cut (const Line &line1, const Line &line2) const |
Compute the cut of the line between two lines. | |
Point | closest (const Point &point) const |
Compute the point on the line that is closest to point . | |
Point | mirror (const Point &point, float scale=1) const |
Mirror a point with respect to the line. | |
Line & | mirror (const Line &mirror, float scale=1) |
Mirror the line with respect to the given line. | |
Line | get_mirror (const Line &mirror) const |
Return the line mirrored with respect to the given line. | |
template<typename T> | |
T & | map (T &obj) |
Map the integer points of the line. | |
Public Attributes | |
Point | a |
The first end point. | |
Point | b |
The second end point. |
|
Create a line.
|
|
Create a line.
|
|
Create a line by converting from the polar representation (rho, theta).
|
|
Add a point to the end points of the line.
|
|
Compute the point on the line that is closest to
|
|
Cut the line between two lines. The first point will be the intersection with the first line, and the second point will be the intersection with the second line.
|
|
Compute the cut of the line between two lines. The first point will be the intersection with the first line, and the second point will be the intersection with the second line.
|
|
Return the line mirrored with respect to the given line.
|
|
Compute the intersection with
|
|
Map the integer points of the line.
The method calls
|
|
Mirror the line with respect to the given line.
|
|
Mirror a point with respect to the line.
|
|
Compute the normal of the line. Note that the length of the normal is not normalized to one.
|
|
Compute the tangent of the line. Note that the length of the tangent is not normalized to one.
|