Belle II Software development
Line2D Class Reference

A two dimensional normal line. More...

#include <Line2D.h>

Public Member Functions

 Line2D ()
 Default constructor for ROOT compatibility.
 
 Line2D (const double n0, const double n1, const double n2)
 Constructs taking all three line parameters.
 
 Line2D (const double n0, const ROOT::Math::XYVector &n12)
 Constructs taking the distance to the origin ( n0 ) and the normal vector.
 
double n0 () const
 Getter for the first line parameter.
 
double n1 () const
 Getter for the second line parameter.
 
double n2 () const
 Getter for the third line parameter.
 
const ROOT::Math::XYVector & n12 () const
 Getter for the unit normal vector to the line.
 
void setN0 (const double n0)
 Setter for first line parameter This sets the signed distance of the line to the origin.
 
void setN (const double n0, const double n1, const double n2)
 Setter the for the line parameters which takes care of the correct normalization of the normal vector.
 
void invalidate ()
 Sets all line parameters to zero.
 
void setSlopeIntercept (const double slope, const double intercept)
 Sets the new intercept and slope of the line the direction is set to be forward with the increasing x axes.
 
void setSlopeIntercept (const double slope, const double intercept, const EForwardBackward orientation)
 Sets the new intercept and slope of the line the direction is set to be forward with the increasing x axes.
 
void normalize ()
 Updates the parameters to obey the normalization condition.
 
void reverse ()
 Flips orientation the line in place.
 
Line2D reversed () const
 Returns a copy of the line with the reversed orientation.
 
double distance (const ROOT::Math::XYVector &point) const
 Calculates the signed distance of the point to the line.
 
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 distanceToOrigin () const
 Returns the distance to the origin The distance to the origin is equivalent to the first line parameter.
 
double absoluteDistance (const ROOT::Math::XYVector &point) const
 Returns the absolute value of distance(point)
 
ERightLeft isRightOrLeft (const ROOT::Math::XYVector &point) const
 Return if the point given is right or left of the line.
 
bool isLeft (const ROOT::Math::XYVector &rhs) const
 Return if the point given is left of the line.
 
bool isRight (const ROOT::Math::XYVector &rhs) const
 Return if the point given is right of the line.
 
ROOT::Math::XYVector closest (const ROOT::Math::XYVector &point) const
 Calculates the point of closest approach on the line to the point.
 
ROOT::Math::XYVector closestToOrigin () const
 Returns the point closest to the origin.
 
double lengthOnCurve (const ROOT::Math::XYVector &from, const ROOT::Math::XYVector &to) const
 Calculates the length on the curve between two points.
 
bool isInvalid () const
 Indicates if all circle parameters are zero.
 
ROOT::Math::XYVector tangential () const
 Gives the tangential vector in the direction of positive advance on the line.
 
const ROOT::Math::XYVector & normal () const
 Getter for the unit normal vector of the line.
 
const ROOT::Math::XYVector & gradient () const
 Getter for the gradient of the distance field.
 
ROOT::Math::XYVector support () const
 Getter for the support point of the line being the point closest to the origin.
 
EForwardBackward alignedWithFirst () const
 Returns if the direction of positive advance has a common component aligned or anti aligned with the first coordinate.
 
EForwardBackward alignedWithSecond () const
 Returns if the direction of positive advance has a common component aligned or anti aligned with the second coordinate.
 
ROOT::Math::XYVector intersection (const Line2D &line) const
 Calculates the intersection point of two line. Infinity for parallels.
 
Transformations of the line
void moveBy (const ROOT::Math::XYVector &by)
 Actively moves the line in the direction given in place by the vector given.
 
void moveAlongFirst (const double first)
 Actively moves the line in the direction given in place along the first coordinate.
 
void moveAlongSecond (const double second)
 Actively moves the line in the direction given in place along the second coordinate.
 
Line2D movedAlongFirst (const double first) const
 Return a copy of the line actively moved long the first coordinate.
 
Line2D movedAlongSecond (const double second) const
 Return a copy of the line actively moved long the first coordinate.
 
void passiveMoveBy (const ROOT::Math::XYVector &by)
 Passively move the coordinate system in place by the given vector.
 
void passiveMoveAlongFirst (const double first)
 Passively move the coordinate system in place along the first coordinate.
 
void passiveMoveAlongSecond (const double second)
 Passively move the coordinate system in place along the second coordinate.
 
Line2D passiveMovedAlongFirst (const double first) const
 Return a copy of the line passively moved long the first coordinate.
 
Line2D passiveMovedAlongSecond (const double second) const
 Return a copy of the line passively moved long the first coordinate.
 
void flipFirst ()
 Flips the first coordinate inplace (no difference between active and passive)
 
void flipSecond ()
 Flips the first coordinate inplace (no difference between active and passive)
 
Line2D flippedFirst () const
 Makes a copy of the line with the first coordinate flipped (no difference between active and passive)
 
Line2D flippedSecond () const
 Makes a copy of the line with the second coordinate flipped (no difference between active and passive)
 
Line as a function of the first coordinate
double slope () const
 Returns the slope over the first coordinate.
 
double inverseSlope () const
 Returns the slope over the second coordinate.
 
double intercept () const
 Returns the intercept over the first coordinate.
 
double zero () const
 Returns the root of the line.
 
double map (const double first) const
 Maps the first coordinate to the second.
 
double operator() (const double first) const
 Maps the first coordinate to the second.
 
double inverseMap (const double second) const
 Maps the second coordinate to the first.
 
void invert ()
 Turns the line function into its inverse function in place.
 
Line2D inverted () const
 Returns the inverse function line as a copy.
 

Static Public Member Functions

static Line2D fromSlopeIntercept (const double slope, const double intercept)
 Constructs a line from its slope and intercept over the first coordinate (default forward orientation).
 
static Line2D fromSlopeIntercept (const double slope, const double intercept, const EForwardBackward orientation)
 Constructs a line from its slope and intercept over the first coordinate with the given orientation.
 
static Line2D throughPoints (const ROOT::Math::XYVector &start, const ROOT::Math::XYVector &end)
 Constructs a line through the two given points.
 

Private Member Functions

void setN1 (const double n1)
 Setter for the second line parameter. May violate the normalization.
 
void setN2 (const double n2)
 Setter for the third line parameter. May violate the normalization.
 
void setN12 (const double n1, const double n2)
 Setter for the normal vector by its coordinates.
 
void setN12 (const ROOT::Math::XYVector &n12)
 Setter for the normal vector.
 
void scaleN (const double factor)
 Scales all parameters. Helper for normalize.
 
double normalizationSquared () const
 Calculates the squared normalization. Helper for normalize.
 
double normalization () const
 Calculates the normalization. Helper for normalize.
 

Private Attributes

double m_n0
 Memory for the first line parameter.
 
ROOT::Math::XYVector m_n12
 Memory for the second line parameter.
 

Detailed Description

A two dimensional normal line.

This class represents a line in two dimensional space by its normal definition n0 + n1*x + n2*y = 0 subjected to n1*n1 + n2*n2 = 1. The vector (n1, n2) is called unit normal vector. It has an orientation. It is defining a right half plane with all points having n0 + n1*x + n2*y > 0 and a left half plane for point having n0 + n1*x + n2*y < 0 This naturally corresponds to a direction of positive advance being the tangential to the line (-n2, n1). This line is best suited for linear least square fits.

Definition at line 39 of file Line2D.h.

Constructor & Destructor Documentation

◆ Line2D() [1/3]

Line2D ( )
inline

Default constructor for ROOT compatibility.

Definition at line 43 of file Line2D.h.

44 : m_n0(0.0)
45 , m_n12(0.0, 0.0)
46 {
47 }

◆ Line2D() [2/3]

Line2D ( const double n0,
const double n1,
const double n2 )
inline

Constructs taking all three line parameters.

Definition at line 50 of file Line2D.h.

51 : m_n0(n0)
52 , m_n12(n1, n2)
53 {
54 normalize();
55 }

◆ Line2D() [3/3]

Line2D ( const double n0,
const ROOT::Math::XYVector & n12 )
inline

Constructs taking the distance to the origin ( n0 ) and the normal vector.

Definition at line 58 of file Line2D.h.

59 : m_n0(n0)
60 , m_n12(n12)
61 {
62 normalize();
63 }

Member Function Documentation

◆ absoluteDistance()

double absoluteDistance ( const ROOT::Math::XYVector & point) const
inline

Returns the absolute value of distance(point)

Definition at line 270 of file Line2D.h.

271 {
272 return fabs(distance(point));
273 }

◆ alignedWithFirst()

EForwardBackward alignedWithFirst ( ) const
inline

Returns if the direction of positive advance has a common component aligned or anti aligned with the first coordinate.

Definition at line 351 of file Line2D.h.

352 {
353 return static_cast<EForwardBackward>(-sign(n2()));
354 }
EForwardBackward
Enumeration to represent the distinct possibilities of the right left passage information.

◆ alignedWithSecond()

EForwardBackward alignedWithSecond ( ) const
inline

Returns if the direction of positive advance has a common component aligned or anti aligned with the second coordinate.

Definition at line 358 of file Line2D.h.

359 {
360 return static_cast<EForwardBackward>(sign(n1()));
361 }

◆ closest()

ROOT::Math::XYVector closest ( const ROOT::Math::XYVector & point) const
inline

Calculates the point of closest approach on the line to the point.

Definition at line 294 of file Line2D.h.

295 {
296 const double closestParallel = -n0();
297 const double closestOrthgonal = VectorUtil::unnormalizedOrthogonalComp(point, n12());
298 return VectorUtil::compose(n12(), closestParallel, closestOrthgonal);
299 }

◆ closestToOrigin()

ROOT::Math::XYVector closestToOrigin ( ) const
inline

Returns the point closest to the origin.

Definition at line 302 of file Line2D.h.

303 {
304 return n12() * (-n0());
305 }

◆ distance() [1/2]

double distance ( const double first,
const double second ) const
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 positive
for the right side of the line and negative for the left side.

Definition at line 255 of file Line2D.h.

256 {
257 return n0() + first * n1() + second * n2();
258 }

◆ distance() [2/2]

double distance ( const ROOT::Math::XYVector & point) const
inline

Calculates the signed distance of the point to the line.

Returns the signed distance of the point to the line. The sign is positive
for the right side of the line and negative for the left side.

Definition at line 245 of file Line2D.h.

246 {
247 return n0() + point.Dot(n12());
248 }

◆ distanceToOrigin()

double distanceToOrigin ( ) const
inline

Returns the distance to the origin The distance to the origin is equivalent to the first line parameter.

Definition at line 264 of file Line2D.h.

265 {
266 return n0();
267 }

◆ flipFirst()

void flipFirst ( )
inline

Flips the first coordinate inplace (no difference between active and passive)

Definition at line 429 of file Line2D.h.

430 {
431 m_n12.SetX(-m_n12.X());
432 }

◆ flippedFirst()

Line2D flippedFirst ( ) const
inline

Makes a copy of the line with the first coordinate flipped (no difference between active and passive)

Definition at line 442 of file Line2D.h.

443 {
444 return Line2D(n0(), ROOT::Math::XYVector(-n12().X(), n12().Y()));
445 }

◆ flippedSecond()

Line2D flippedSecond ( ) const
inline

Makes a copy of the line with the second coordinate flipped (no difference between active and passive)

Definition at line 449 of file Line2D.h.

450 {
451 return Line2D(n0(), ROOT::Math::XYVector(n12().X(), -n12().Y()));
452 }

◆ flipSecond()

void flipSecond ( )
inline

Flips the first coordinate inplace (no difference between active and passive)

Definition at line 435 of file Line2D.h.

436 {
437 m_n12.SetY(-m_n12.Y());
438 }

◆ fromSlopeIntercept() [1/2]

static Line2D fromSlopeIntercept ( const double slope,
const double intercept )
inlinestatic

Constructs a line from its slope and intercept over the first coordinate (default forward orientation).

Constructs a line of the points fulfilling y = slope *x + intercept. The Line2D has an additional orientation in contrast to y = slope *x + intercept. The default orientation for the line is forward with the positive x axes.

Definition at line 72 of file Line2D.h.

73 {
74 return Line2D(intercept, slope, -EForwardBackward::c_Forward);
75 }

◆ fromSlopeIntercept() [2/2]

static Line2D fromSlopeIntercept ( const double slope,
const double intercept,
const EForwardBackward orientation )
inlinestatic

Constructs a line from its slope and intercept over the first coordinate with the given orientation.

Constructs a line of the points fulfilling y = slope *x + intercept. The Line2D has an additional orientation in contrast to y = slope *x + intercept. The forward backward info sets if the constructed line shall have the direction with increasing or
decreasing x respectively.

Definition at line 86 of file Line2D.h.

89 {
90 return Line2D(intercept * static_cast<double>(orientation), slope * static_cast<double>(orientation), -orientation);
91 }

◆ gradient()

const ROOT::Math::XYVector & gradient ( ) const
inline

Getter for the gradient of the distance field.

Definition at line 338 of file Line2D.h.

339 {
340 return n12();
341 }

◆ intercept()

double intercept ( ) const
inline

Returns the intercept over the first coordinate.

Definition at line 471 of file Line2D.h.

472 {
473 return -n0() / n2();
474 }

◆ intersection()

ROOT::Math::XYVector intersection ( const Line2D & line) const

Calculates the intersection point of two line. Infinity for parallels.

Definition at line 13 of file Line2D.cc.

14{
15
16 double determinant = VectorUtil::Cross(n12(), line.n12());
17 ROOT::Math::XYVector result(-n0() * line.n2() + line.n0() * n2(), n0() * line.n1() - line.n0() * n1());
18
19 result /= determinant;
20 return result;
21}
double n1() const
Getter for the second line parameter.
Definition Line2D.h:107
const ROOT::Math::XYVector & n12() const
Getter for the unit normal vector to the line.
Definition Line2D.h:119
double n2() const
Getter for the third line parameter.
Definition Line2D.h:113
double n0() const
Getter for the first line parameter.
Definition Line2D.h:101

◆ invalidate()

void invalidate ( )
inline

Sets all line parameters to zero.

Definition at line 172 of file Line2D.h.

173 {
174 setN(0.0, 0.0, 0.0);
175 }

◆ inverseMap()

double inverseMap ( const double second) const
inline

Maps the second coordinate to the first.

Definition at line 494 of file Line2D.h.

495 {
496 return -(n0() + n2() * second) / n1();
497 }

◆ inverseSlope()

double inverseSlope ( ) const
inline

Returns the slope over the second coordinate.

Definition at line 465 of file Line2D.h.

466 {
467 return -n2() / n1();
468 }

◆ invert()

void invert ( )
inline

Turns the line function into its inverse function in place.

Definition at line 500 of file Line2D.h.

501 {
502 m_n12.SetXY(m_n12.Y(), m_n12.X());
503 reverse();
504 }

◆ inverted()

Line2D inverted ( ) const
inline

Returns the inverse function line as a copy.

Definition at line 507 of file Line2D.h.

508 {
509 return Line2D(-n0(), -n2(), -n1());
510 }

◆ isInvalid()

bool isInvalid ( ) const
inline

Indicates if all circle parameters are zero.

Definition at line 320 of file Line2D.h.

321 {
322 return n0() == 0.0 and VectorUtil::isNull(n12());
323 }

◆ isLeft()

bool isLeft ( const ROOT::Math::XYVector & rhs) const
inline

Return if the point given is left of the line.

Definition at line 282 of file Line2D.h.

283 {
284 return isRightOrLeft(rhs) == ERightLeft::c_Left;
285 }

◆ isRight()

bool isRight ( const ROOT::Math::XYVector & rhs) const
inline

Return if the point given is right of the line.

Definition at line 288 of file Line2D.h.

289 {
290 return isRightOrLeft(rhs) == ERightLeft::c_Right;
291 }

◆ isRightOrLeft()

ERightLeft isRightOrLeft ( const ROOT::Math::XYVector & point) const
inline

Return if the point given is right or left of the line.

Definition at line 276 of file Line2D.h.

277 {
278 return static_cast<ERightLeft>(sign(distance(point)));
279 }
ERightLeft
Enumeration to represent the distinct possibilities of the right left passage.
Definition ERightLeft.h:25

◆ lengthOnCurve()

double lengthOnCurve ( const ROOT::Math::XYVector & from,
const ROOT::Math::XYVector & to ) const
inline

Calculates the length on the curve between two points.

Takes to two point to their closest approach to the origin and calculates the distance between them. The length is signed taken relative to the direction of positive advance.

Definition at line 314 of file Line2D.h.

315 {
316 return VectorUtil::unnormalizedOrthogonalComp(to, n12()) - VectorUtil::unnormalizedOrthogonalComp(from, n12());
317 }

◆ map()

double map ( const double first) const
inline

Maps the first coordinate to the second.

Definition at line 483 of file Line2D.h.

484 {
485 return -(n0() + n1() * first) / n2();
486 }

◆ moveAlongFirst()

void moveAlongFirst ( const double first)
inline

Actively moves the line in the direction given in place along the first coordinate.

Definition at line 375 of file Line2D.h.

376 {
377 m_n0 -= n1() * first;
378 }

◆ moveAlongSecond()

void moveAlongSecond ( const double second)
inline

Actively moves the line in the direction given in place along the second coordinate.

Definition at line 381 of file Line2D.h.

382 {
383 m_n0 -= n2() * second;
384 }

◆ moveBy()

void moveBy ( const ROOT::Math::XYVector & by)
inline

Actively moves the line in the direction given in place by the vector given.

Definition at line 369 of file Line2D.h.

370 {
371 m_n0 -= VectorUtil::unnormalizedParallelComp(by, n12());
372 }

◆ movedAlongFirst()

Line2D movedAlongFirst ( const double first) const
inline

Return a copy of the line actively moved long the first coordinate.

Definition at line 387 of file Line2D.h.

388 {
389 return Line2D(n0() - n1() * first, n1(), n2());
390 }

◆ movedAlongSecond()

Line2D movedAlongSecond ( const double second) const
inline

Return a copy of the line actively moved long the first coordinate.

Definition at line 393 of file Line2D.h.

394 {
395 return Line2D(n0() - n2() * second, n1(), n2());
396 }

◆ n0()

double n0 ( ) const
inline

Getter for the first line parameter.

Definition at line 101 of file Line2D.h.

102 {
103 return m_n0;
104 }

◆ n1()

double n1 ( ) const
inline

Getter for the second line parameter.

Definition at line 107 of file Line2D.h.

108 {
109 return m_n12.X();
110 }

◆ n12()

const ROOT::Math::XYVector & n12 ( ) const
inline

Getter for the unit normal vector to the line.

Definition at line 119 of file Line2D.h.

120 {
121 return m_n12;
122 }

◆ n2()

double n2 ( ) const
inline

Getter for the third line parameter.

Definition at line 113 of file Line2D.h.

114 {
115 return m_n12.Y();
116 }

◆ normal()

const ROOT::Math::XYVector & normal ( ) const
inline

Getter for the unit normal vector of the line.

Definition at line 332 of file Line2D.h.

333 {
334 return n12();
335 }

◆ normalization()

double normalization ( ) const
inlineprivate

Calculates the normalization. Helper for normalize.

Definition at line 234 of file Line2D.h.

235 {
236 return sqrt(normalizationSquared());
237 }
double sqrt(double a)
sqrt for double
Definition beamHelpers.h:28

◆ normalizationSquared()

double normalizationSquared ( ) const
inlineprivate

Calculates the squared normalization. Helper for normalize.

Definition at line 228 of file Line2D.h.

229 {
230 return n12().Mag2();
231 }

◆ normalize()

void normalize ( )
inline

Updates the parameters to obey the normalization condition.

Definition at line 200 of file Line2D.h.

201 {
202 if (not isInvalid()) {
203 scaleN(1.0 / normalization());
204 }
205 }

◆ operator()()

double operator() ( const double first) const
inline

Maps the first coordinate to the second.

Definition at line 488 of file Line2D.h.

489 {
490 return map(first);
491 }

◆ passiveMoveAlongFirst()

void passiveMoveAlongFirst ( const double first)
inline

Passively move the coordinate system in place along the first coordinate.

Definition at line 405 of file Line2D.h.

406 {
407 m_n0 += n1() * first;
408 }

◆ passiveMoveAlongSecond()

void passiveMoveAlongSecond ( const double second)
inline

Passively move the coordinate system in place along the second coordinate.

Definition at line 411 of file Line2D.h.

412 {
413 m_n0 += n2() * second;
414 }

◆ passiveMoveBy()

void passiveMoveBy ( const ROOT::Math::XYVector & by)
inline

Passively move the coordinate system in place by the given vector.

Definition at line 399 of file Line2D.h.

400 {
401 m_n0 += VectorUtil::unnormalizedParallelComp(by, n12());
402 }

◆ passiveMovedAlongFirst()

Line2D passiveMovedAlongFirst ( const double first) const
inline

Return a copy of the line passively moved long the first coordinate.

Definition at line 417 of file Line2D.h.

418 {
419 return Line2D(n0() + n1() * first, n1(), n2());
420 }

◆ passiveMovedAlongSecond()

Line2D passiveMovedAlongSecond ( const double second) const
inline

Return a copy of the line passively moved long the first coordinate.

Definition at line 423 of file Line2D.h.

424 {
425 return Line2D(n0() + n2() * second, n1(), n2());
426 }

◆ reverse()

void reverse ( )
inline

Flips orientation the line in place.

Definition at line 208 of file Line2D.h.

209 {
210 scaleN(-1.0);
211 }

◆ reversed()

Line2D reversed ( ) const
inline

Returns a copy of the line with the reversed orientation.

Definition at line 214 of file Line2D.h.

215 {
216 return Line2D(-n0(), -n1(), -n2());
217 }

◆ scaleN()

void scaleN ( const double factor)
inlineprivate

Scales all parameters. Helper for normalize.

Definition at line 221 of file Line2D.h.

222 {
223 m_n0 *= factor;
224 m_n12 *= factor;
225 }

◆ setN()

void setN ( const double n0,
const double n1,
const double n2 )
inline

Setter the for the line parameters which takes care of the correct normalization of the normal vector.

Definition at line 164 of file Line2D.h.

165 {
166 setN0(n0);
167 setN12(n1, n2);
168 normalize();
169 }

◆ setN0()

void setN0 ( const double n0)
inline

Setter for first line parameter This sets the signed distance of the line to the origin.

Its not involved in the normalization hence it can be exported as a public function.

Definition at line 131 of file Line2D.h.

132 {
133 m_n0 = n0;
134 }

◆ setN1()

void setN1 ( const double n1)
inlineprivate

Setter for the second line parameter. May violate the normalization.

Definition at line 138 of file Line2D.h.

139 {
140 m_n12.SetX(n1);
141 }

◆ setN12() [1/2]

void setN12 ( const double n1,
const double n2 )
inlineprivate

Setter for the normal vector by its coordinates.

Definition at line 150 of file Line2D.h.

151 {
152 m_n12.SetXY(n1, n2);
153 }

◆ setN12() [2/2]

void setN12 ( const ROOT::Math::XYVector & n12)
inlineprivate

Setter for the normal vector.

Definition at line 156 of file Line2D.h.

157 {
158 m_n12.SetXY(n12.X(), n12.Y());
159 }

◆ setN2()

void setN2 ( const double n2)
inlineprivate

Setter for the third line parameter. May violate the normalization.

Definition at line 144 of file Line2D.h.

145 {
146 m_n12.SetY(n2);
147 }

◆ setSlopeIntercept() [1/2]

void setSlopeIntercept ( const double slope,
const double intercept )
inline

Sets the new intercept and slope of the line the direction is set to be forward with the increasing x axes.

Definition at line 179 of file Line2D.h.

180 {
181 setN0(intercept);
182 setN1(slope);
183 setN2(-1.0);
184 normalize();
185 }

◆ setSlopeIntercept() [2/2]

void setSlopeIntercept ( const double slope,
const double intercept,
const EForwardBackward orientation )
inline

Sets the new intercept and slope of the line the direction is set to be forward with the increasing x axes.

Definition at line 189 of file Line2D.h.

192 {
193 setN0(intercept * static_cast<double>(orientation));
194 setN1(slope * static_cast<double>(orientation));
195 setN2(-orientation);
196 normalize();
197 }

◆ slope()

double slope ( ) const
inline

Returns the slope over the first coordinate.

Definition at line 459 of file Line2D.h.

460 {
461 return -n1() / n2();
462 }

◆ support()

ROOT::Math::XYVector support ( ) const
inline

Getter for the support point of the line being the point closest to the origin.

Definition at line 344 of file Line2D.h.

345 {
346 return closestToOrigin();
347 }

◆ tangential()

ROOT::Math::XYVector tangential ( ) const
inline

Gives the tangential vector in the direction of positive advance on the line.

Definition at line 326 of file Line2D.h.

327 {
328 return VectorUtil::Orthogonal(normal());
329 }

◆ throughPoints()

static Line2D throughPoints ( const ROOT::Math::XYVector & start,
const ROOT::Math::XYVector & end )
inlinestatic

Constructs a line through the two given points.

Definition at line 94 of file Line2D.h.

95 {
96 return Line2D(VectorUtil::Cross(end, start), VectorUtil::Orthogonal(start - end));
97 }

◆ zero()

double zero ( ) const
inline

Returns the root of the line.

Definition at line 477 of file Line2D.h.

478 {
479 return -n0() / n1();
480 }

Member Data Documentation

◆ m_n0

double m_n0
private

Memory for the first line parameter.

Definition at line 515 of file Line2D.h.

◆ m_n12

ROOT::Math::XYVector m_n12
private

Memory for the second line parameter.

Definition at line 518 of file Line2D.h.


The documentation for this class was generated from the following files: