Belle II Software
release-08-01-10
|
A line with a support point and tangential vector. More...
#include <ParameterLine2D.h>
Public Member Functions | |
ParameterLine2D () | |
Default constructor for ROOT compatibility. | |
ParameterLine2D (const Vector2D &support, const Vector2D &tangential) | |
Standard constructor taking the support point and the tangential vector. | |
ParameterLine2D (const Line2D &line) | |
Upcast the normal representation to a parameter line. More... | |
operator Line2D () | |
Downcast the line to the normal representation. More... | |
const Vector2D & | tangential () const |
Gives the tangential vector of the line. | |
Vector2D | normal () const |
Gives the normal vector of the line. | |
const Vector2D & | support () const |
Gives the support vector of the line. | |
Vector2D | at (const double parameter) const |
Evaluates the line formula at the parameter given. | |
EForwardBackward | alignedWithFirst () const |
Indicates if the tangential vector point in a commmon direction with the first coordinate axes. | |
EForwardBackward | alignedWithSecond () const |
Indicates if the tangential vector point in a commmon direction with the second coordinate axes. | |
void | normalize () |
Normalizes the tangential vector inplace. More... | |
void | invalidate () |
Clear all information from the line. | |
bool | isInvalid () const |
Check it the line is in an invalid state. | |
void | reverse () |
Reverses the tangential vector inplace. | |
ParameterLine2D | reversed () const |
Makes a copy line which has the opposite tangential vector but same support point. | |
double | distance (const Vector2D &point) const |
Gives the signed distance of a point to the line. More... | |
double | distance (const double first, const double second) const |
Calculates the signed distance of the point given by its to coordinates to the line. More... | |
double | distanceToOrigin () const |
Gives the signed distance of the origin. | |
double | absoluteDistance (const Vector2D &point) const |
Gives the unsigned distance of a point to the line. | |
ERightLeft | isRightOrLeft (const Vector2D &point) const |
Return if the point given is right or left of the line. | |
bool | isLeft (const Vector2D &rhs) const |
Return if the point given is left of the line. | |
bool | isRight (const Vector2D &rhs) const |
Return if the point given is right of the line. | |
Vector2D | closest (const Vector2D &point) const |
Gives the position at the closest approach on the line to point. | |
double | closestAt (const Vector2D &point) const |
Gives the line parameter at the closest approach to point. | |
Vector2D | closestToOrigin () const |
Gives the position of closest approach to the origin. | |
double | closestToOriginAt () const |
Gives the line parameter at the closest approach to the origin. | |
double | lengthOnCurve (const Vector2D &from, const Vector2D &to) const |
Denotes the length on the line between the two points. | |
double | intersectionAt (const Line2D &line) const |
Gives the line parameter where the two lines meet. Infinity for parallels. | |
double | intersectionAt (const ParameterLine2D &line) const |
Gives the line parameter of this line where the two lines meet. Infinity for parallels. | |
std::pair< double, double > | intersectionsAt (const GeneralizedCircle &genCircle) const |
Gives the line parameters of this line, where it intersects with the generalized circle. More... | |
Vector2D | intersection (const Line2D &line) const |
Gives the point where the two lines meet. Infinities for parallels. | |
Vector2D | intersection (const ParameterLine2D &line) const |
Gives the point where the two lines meet. Infinities for parallels. | |
Transformations of the line | |
void | passiveMoveAtBy (const double delta) |
Moves the support point by the given amount of the parameter in the forward direction. More... | |
void | moveBy (const Vector2D &by) |
Moves the line in the given direction in place. Corresponds to an active transformation. | |
void | moveAlongFirst (const double first) |
Moves the line along the first coordinate axes in place. More... | |
void | moveAlongSecond (const double second) |
Moves the line along the second coordinate axes in place. More... | |
void | passiveMoveBy (const Vector2D &by) |
Moves the coordinate system in the given direction in place. More... | |
void | passiveMoveAlongFirst (const double first) |
Moves the coordinate system along the first coordinate axes in place. More... | |
void | passiveMoveAlongSecond (const double second) |
Moves the coordinate system along the second coordinate axes in place. More... | |
Line as a function of the first coordinate | |
The next couple of methods are to interpret the line as a function mapping from first to second coordinate | |
double | slope () const |
The line slope. | |
double | inverseSlope () const |
The inveres line slope. | |
double | intercept () const |
Second coordinate for first being zero. | |
double | zero () const |
First coordinate for second being zero. | |
double | map (const double first) const |
Method mapping the first coordinate to the second according to the line. | |
double | operator() (const double first) const |
Operator mapping the first coordinate to the second according to the line. | |
double | inverseMap (const double second) const |
Method for the inverse mapping the second coordinate to the first according to the line. | |
void | invert () |
Turns the line into its inverse function in place. Orientation will be flipped as well. | |
ParameterLine2D | inverted () const |
Gives the line assoziated with the inverse function as a copy. | |
Static Public Member Functions | |
static ParameterLine2D | fromSlopeIntercept (const double slope, const double intercept) |
Constructs a line with slope and intercept. More... | |
static ParameterLine2D | fromSlopeIntercept (const double slope, const double intercept, const EForwardBackward orientation) |
Constructs a line with slope and intercept. More... | |
static ParameterLine2D | throughPoints (const Vector2D &start, const Vector2D &end) |
Static constructor for a line between to points. More... | |
static ParameterLine2D | touchingCircles (const Vector2D &fromCenter, double fromSignedRadius, const Vector2D &toCenter, double toSignedRadius) |
Constructs a line touching two circles in one point each. More... | |
Private Attributes | |
Vector2D | m_support |
Support vector of the line. | |
Vector2D | m_tangential |
Tangential vector of the line. | |
A line with a support point and tangential vector.
Implements the representation where
is the support point and is the tangential vector
is called the parameter of the line. In the same sense as the Line2D
this line defines a direction of positiv advance ( the tangential vector ) as well as
a right and a left half plane.
Definition at line 38 of file ParameterLine2D.h.
|
inlineexplicit |
Upcast the normal representation to a parameter line.
Upcasting requires some additional information to be set namely the support point and the scale of the tangential. The support is set the point closest to the origin. The tangential is of unit length. Note the orientation of the line remains the same.
Definition at line 93 of file ParameterLine2D.h.
|
inline |
Calculates the signed distance of the point given by its to coordinates to the line.
Returns the signed distance of the point to the line. The sign is positiv
for the right side of the line and negativ for the left side.
Definition at line 209 of file ParameterLine2D.h.
|
inline |
Gives the signed distance of a point to the line.
Returns the signed distance of the point to the line. The sign is positiv
for the right side of the line and negativ for the left side.
Definition at line 201 of file ParameterLine2D.h.
|
inlinestatic |
Constructs a line with slope and intercept.
Orientation will be coaligned with the first axes. Tangential vector is normalized to have a unit in the first coordinate.
Definition at line 59 of file ParameterLine2D.h.
|
inlinestatic |
Constructs a line with slope and intercept.
Orientation means the alignment with the first axes. Orientation will be coaligned or antialigned as given. Tangential vector is normalized to have a unit in the first coordinate.
Definition at line 69 of file ParameterLine2D.h.
|
inline |
Gives the line parameters of this line, where it intersects with the generalized circle.
Calculates the two line parameters of the intersections with the circle as a pair. The second of the pair is always the small of the two solutions, which is closer to the support point.
Definition at line 296 of file ParameterLine2D.h.
|
inline |
Moves the line along the first coordinate axes in place.
Corresponds to an active transformation.
Definition at line 336 of file ParameterLine2D.h.
|
inline |
Moves the line along the second coordinate axes in place.
Corresponds to an active transformation.
Definition at line 343 of file ParameterLine2D.h.
|
inline |
Normalizes the tangential vector inplace.
Normalizes the line representation such that the parameter is indentical with the distance from the support point of a point on the line. This can be usefull if you want to give the parameter a certain meaning where you have to get rid of the proportional factor assizated with the length of the tangential.
Definition at line 167 of file ParameterLine2D.h.
|
inline |
Downcast the line to the normal representation.
Downcasting the parameter line to the line representation using the normal vector. You loose the information where the support point is and the scale of the parameter. However the same points lie on the line and distance to is remain the same
Definition at line 118 of file ParameterLine2D.h.
|
inline |
Moves the coordinate system along the first coordinate axes in place.
Corresponds to a passive transformation.
Definition at line 357 of file ParameterLine2D.h.
|
inline |
Moves the coordinate system along the second coordinate axes in place.
Corresponds to a passive transformation.
Definition at line 364 of file ParameterLine2D.h.
|
inline |
Moves the support point by the given amount of the parameter in the forward direction.
This moves the parameter by -delta and the following relation hold
old at(p) = new at(p - delta) hence the coordinate at is diminished
This corresponds to a passive movement of the coordinate system on the line
Definition at line 323 of file ParameterLine2D.h.
|
inline |
Moves the coordinate system in the given direction in place.
Corresponds to a passive transformation.
Definition at line 350 of file ParameterLine2D.h.
|
inlinestatic |
Static constructor for a line between to points.
The resulting line will have start as support. Tangential vector is the difference between end and start. Hence at(0) == start and at(1) == end for the constructed line.
Definition at line 82 of file ParameterLine2D.h.
|
static |
Constructs a line touching two circles in one point each.
[in] | fromCenter | first circle center |
[in] | fromSignedRadius | radius of the first circle multiplied with the right left passage information |
[in] | toCenter | second circle center |
[in] | toSignedRadius | radius of the first circle multiplied with the right left passage information. |
Definition at line 17 of file ParameterLine2D.cc.