Belle II Software  release-08-01-10
Arc2D.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 
9 /* Own header. */
10 #include <klm/eklm/geometry/Arc2D.h>
11 
12 using namespace Belle2;
13 
14 EKLM::Arc2D::Arc2D(double x, double y, double radius,
15  double angle1, double angle2) :
16  Circle2D(x, y, radius),
17  m_Angle1(angle1),
18  m_Angle2(angle2)
19 {
20 }
21 
23 {
24 }
25 
26 bool EKLM::Arc2D::angleWithinRange(double angle) const
27 {
28  if (m_Angle2 > m_Angle1)
29  return (angle <= m_Angle2 && angle >= m_Angle1);
30  return (angle >= m_Angle1 || angle <= m_Angle2);
31 }
32 
34 {
36  p.setX(m_Radius * cos(m_Angle1));
37  p.setY(m_Radius * sin(m_Angle1));
38  p.setZ(0);
39  return p;
40 }
41 
Arc2D(double x, double y, double radius, double angle1, double angle2)
Constructor.
Definition: Arc2D.cc:14
~Arc2D()
Destructor.
Definition: Arc2D.cc:22
bool angleWithinRange(double angle) const
Check if angle is within the arc.
Definition: Arc2D.cc:26
HepGeom::Point3D< double > getInitialPoint() const
Get initial point.
Definition: Arc2D.cc:33
Abstract base class for different kinds of events.