Belle II Software  release-08-01-10
Line2D.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #include <tracking/trackFindingCDC/geometry/Line2D.h>
9 
10 #include <tracking/trackFindingCDC/geometry/Vector2D.h>
11 
12 using namespace Belle2;
13 using namespace TrackFindingCDC;
14 
16 {
17 
18  double determinant = n12().cross(line.n12());
19  Vector2D result(-n0() * line.n2() + line.n0() * n2(), n0() * line.n1() - line.n0() * n1());
20 
21  result /= determinant;
22  return result;
23 }
A two dimensional normal line.
Definition: Line2D.h:37
const Vector2D & n12() const
Getter for the unit normal vector to the line.
Definition: Line2D.h:117
double n1() const
Getter for the second line parameter.
Definition: Line2D.h:105
Vector2D intersection(const Line2D &line) const
Calculates the intersection point of two line. Infinity for parallels.
Definition: Line2D.cc:15
double n2() const
Getter for the third line parameter.
Definition: Line2D.h:111
double n0() const
Getter for the first line parameter.
Definition: Line2D.h:99
A two dimensional vector which is equipped with functions for correct handeling of orientation relat...
Definition: Vector2D.h:35
double cross(const Vector2D &rhs) const
Calculated the two dimensional cross product.
Definition: Vector2D.h:175
Abstract base class for different kinds of events.