Belle II Software  release-05-01-25
Line2D.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2012 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Oliver Frost *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #include <tracking/trackFindingCDC/geometry/Line2D.h>
11 
12 #include <tracking/trackFindingCDC/geometry/Vector2D.h>
13 
14 using namespace Belle2;
15 using namespace TrackFindingCDC;
16 
18 {
19 
20  double determinant = n12().cross(line.n12());
21  Vector2D result(-n0() * line.n2() + line.n0() * n2(), n0() * line.n1() - line.n0() * n1());
22 
23  result /= determinant;
24  return result;
25 }
Belle2::TrackFindingCDC::Line2D::n0
double n0() const
Getter for the first line parameter.
Definition: Line2D.h:109
Belle2::TrackFindingCDC::Vector2D
A two dimensional vector which is equipped with functions for correct handeling of orientation relat...
Definition: Vector2D.h:37
Belle2::TrackFindingCDC::Line2D::n2
double n2() const
Getter for the third line parameter.
Definition: Line2D.h:121
Belle2::TrackFindingCDC::Line2D::intersection
Vector2D intersection(const Line2D &line) const
Calculates the intersection point of two line. Infinity for parallels.
Definition: Line2D.cc:17
Belle2::TrackFindingCDC::Vector2D::cross
double cross(const Vector2D &rhs) const
Calculated the two dimensional cross product.
Definition: Vector2D.h:177
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::Line2D::n1
double n1() const
Getter for the second line parameter.
Definition: Line2D.h:115
Belle2::TrackFindingCDC::Line2D
A two dimensional normal line.
Definition: Line2D.h:47
Belle2::TrackFindingCDC::Line2D::n12
const Vector2D & n12() const
Getter for the unit normal vector to the line.
Definition: Line2D.h:127