10#include <tracking/trackFindingCDC/geometry/GeneralizedCircle.h>
11#include <tracking/trackFindingCDC/geometry/Line2D.h>
12#include <tracking/trackFindingCDC/geometry/Vector2D.h>
14#include <tracking/trackFindingCDC/numerics/Quadratic.h>
15#include <tracking/trackFindingCDC/numerics/EForwardBackward.h>
16#include <tracking/trackFindingCDC/numerics/ERightLeft.h>
17#include <tracking/trackFindingCDC/numerics/ERotation.h>
18#include <tracking/trackFindingCDC/numerics/ESign.h>
29 namespace TrackFindingCDC {
74 Vector2D(orientation,
static_cast<double>(orientation) *
slope));
109 double fromSignedRadius,
111 double toSignedRadius);
209 double distance(
const double first,
const double second)
const
287 return (line.tangential().cross(
support()) - line.tangential().cross(line.support())) /
302 return solveQuadraticABC(a, b, c);
400 double map(
const double first)
const
441 std::ostream& operator<<(std::ostream& output,
const ParameterLine2D& line);
double fastDistance(const Vector2D &point) const
Approximate distance.
Vector2D gradient(const Vector2D &point) const
Gradient of the distance field Gives the gradient of the approximated distance field for the given po...
double n3() const
Getter for the fourth circle parameter.
A two dimensional normal line.
A line with a support point and tangential vector.
ParameterLine2D()
Default constructor for ROOT compatibility.
const Vector2D & support() const
Gives the support vector of the line.
Vector2D m_support
Support vector of the line.
Vector2D m_tangential
Tangential vector of the line.
EForwardBackward alignedWithFirst() const
Indicates if the tangential vector point in a common direction with the first coordinate axes.
static ParameterLine2D fromSlopeIntercept(const double slope, const double intercept)
Constructs a line with slope and intercept.
double absoluteDistance(const Vector2D &point) const
Gives the unsigned distance of a point to the line.
double zero() const
First coordinate for second being zero.
static ParameterLine2D fromSlopeIntercept(const double slope, const double intercept, const EForwardBackward orientation)
Constructs a line with slope and intercept.
bool isInvalid() const
Check it the line is in an invalid state.
ParameterLine2D(const Vector2D &support, const Vector2D &tangential)
Standard constructor taking the support point and the tangential vector.
void reverse()
Reverses the tangential vector inplace.
double slope() const
The line slope.
double map(const double first) const
Method mapping the first coordinate to the second according to the line.
double distance(const Vector2D &point) const
Gives the signed distance of a point to the line.
ParameterLine2D(const Line2D &line)
Upcast the normal representation to a parameter line.
Vector2D at(const double parameter) const
Evaluates the line formula at the parameter given.
Vector2D closestToOrigin() const
Gives the position of closest approach to the origin.
std::pair< double, double > intersectionsAt(const GeneralizedCircle &genCircle) const
Gives the line parameters of this line, where it intersects with the generalized circle.
double distanceToOrigin() const
Gives the signed distance of the origin.
void passiveMoveBy(const Vector2D &by)
Moves the coordinate system in the given direction in place.
double intercept() const
Second coordinate for first being zero.
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.
void moveAlongFirst(const double first)
Moves the line along the first coordinate axes in place.
double intersectionAt(const Line2D &line) const
Gives the line parameter where the two lines meet. Infinity for parallels.
void passiveMoveAtBy(const double delta)
Moves the support point by the given amount of the parameter in the forward direction.
double inverseSlope() const
The inverse line slope.
double inverseMap(const double second) const
Method for the inverse mapping the second coordinate to the first according to the line.
double operator()(const double first) const
Operator mapping the first coordinate to the second according to the line.
void invert()
Turns the line into its inverse function in place. Orientation will be flipped as well.
void passiveMoveAlongFirst(const double first)
Moves the coordinate system along the first coordinate axes in place.
void invalidate()
Clear all information from the line.
ParameterLine2D reversed() const
Makes a copy line which has the opposite tangential vector but same support point.
EForwardBackward alignedWithSecond() const
Indicates if the tangential vector point in a common direction with the second coordinate axes.
Vector2D intersection(const Line2D &line) const
Gives the point where the two lines meet. Infinities for parallels.
void moveBy(const Vector2D &by)
Moves the line in the given direction in place. Corresponds to an active transformation.
ERightLeft isRightOrLeft(const Vector2D &point) const
Return if the point given is right or left of the line.
double intersectionAt(const ParameterLine2D &line) const
Gives the line parameter of this line where the two lines meet. Infinity for parallels.
Vector2D normal() const
Gives the normal vector of the line.
ParameterLine2D inverted() const
Gives the line associated with the inverse function as a copy.
static ParameterLine2D touchingCircles(const Vector2D &fromCenter, double fromSignedRadius, const Vector2D &toCenter, double toSignedRadius)
Constructs a line touching two circles in one point each.
double distance(const double first, const double second) const
Calculates the signed distance of the point given by its to coordinates to the line.
double closestAt(const Vector2D &point) const
Gives the line parameter at the closest approach to point.
Vector2D closest(const Vector2D &point) const
Gives the position at the closest approach on the line to point.
const Vector2D & tangential() const
Gives the tangential vector of the line.
void normalize()
Normalizes the tangential vector inplace.
void passiveMoveAlongSecond(const double second)
Moves the coordinate system along the second coordinate axes in place.
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.
void moveAlongSecond(const double second)
Moves the line along the second coordinate axes in place.
static ParameterLine2D throughPoints(const Vector2D &start, const Vector2D &end)
Static constructor for a line between to points.
Vector2D intersection(const ParameterLine2D &line) const
Gives the point where the two lines meet. Infinities for parallels.
A two dimensional vector which is equipped with functions for correct handling of orientation relate...
void setSecond(const double second)
Setter for the second coordinate.
double normalize()
Normalizes the vector to unit length.
void swapCoordinates()
Swaps the coordinates in place.
double dot(const Vector2D &rhs) const
Calculates the two dimensional dot product.
void set(const double first, const double second)
Setter for both coordinate.
double cross(const Vector2D &rhs) const
Calculated the two dimensional cross product.
Vector2D & reverse()
Reverses the direction of the vector in place.
double orthogonalComp(const Vector2D &relativTo) const
Calculates the component orthogonal to the given vector.
double second() const
Getter for the second coordinate.
double normSquared() const
Calculates .
bool isNull() const
Checks if the vector is the null vector.
Vector2D orthogonal() const
Orthogonal vector to the counterclockwise direction.
double first() const
Getter for the first coordinate.
double norm() const
Calculates the length of the vector.
void setFirst(const double first)
Setter for the first coordinate.
T dot(GeneralVector< T > a, GeneralVector< T > b)
dot product of two general vectors
EForwardBackward
Enumeration to represent the distinct possibilities of the right left passage information.
ERightLeft
Enumeration to represent the distinct possibilities of the right left passage.
Abstract base class for different kinds of events.