Belle II Software development
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/trackingUtilities/geometry/Line2D.h>
9
10using namespace Belle2;
11using namespace TrackingUtilities;
12
13ROOT::Math::XYVector Line2D::intersection(const Line2D& line) const
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}
Line2D()
Default constructor for ROOT compatibility.
Definition Line2D.h:43
double n1() const
Getter for the second line parameter.
Definition Line2D.h:107
ROOT::Math::XYVector intersection(const Line2D &line) const
Calculates the intersection point of two line. Infinity for parallels.
Definition Line2D.cc:13
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
Abstract base class for different kinds of events.