9#include <tracking/trackFindingCDC/geometry/Vector2D.h>
11#include <gtest/gtest.h>
15using namespace TrackFindingCDC;
17TEST(TrackFindingCDCTest, geometry_Vector2D_isBetween)
26 EXPECT_TRUE(test.isBetween(lower, upper));
27 EXPECT_FALSE(test.isBetween(upper, lower));
28 EXPECT_FALSE(test2.
isBetween(lower, upper));
29 EXPECT_TRUE(test2.
isBetween(upper, lower));
41 EXPECT_TRUE(test1.
isBetween(lower, upper));
42 EXPECT_FALSE(test1.
isBetween(upper, lower));
44 EXPECT_FALSE(test2.
isBetween(lower, upper));
45 EXPECT_TRUE(test2.
isBetween(upper, lower));
47 EXPECT_FALSE(test3.isBetween(lower, upper));
48 EXPECT_TRUE(test3.isBetween(upper, lower));
50 EXPECT_FALSE(test4.
isBetween(lower, upper));
51 EXPECT_TRUE(test4.
isBetween(upper, lower));
61 EXPECT_TRUE(test.isBetween(lower, upper));
62 EXPECT_FALSE(test.isBetween(upper, lower));
63 EXPECT_TRUE(test2.
isBetween(lower, upper));
64 EXPECT_FALSE(test2.
isBetween(upper, lower));
68TEST(TrackFindingCDCTest, geometry_Vector2D_flippedOver)
72 Vector2D flippedOver = test.flippedOver(diag);
74 EXPECT_EQ(0, flippedOver.
x());
75 EXPECT_EQ(1, flippedOver.
y());
78TEST(TrackFindingCDCTest, geometry_Vector2D_flippedAlong)
82 Vector2D flippedAlong = test.flippedAlong(diag);
84 EXPECT_EQ(0, flippedAlong.
x());
85 EXPECT_EQ(-1, flippedAlong.
y());
A two dimensional vector which is equipped with functions for correct handling of orientation relate...
double x() const
Getter for the x coordinate.
bool isBetween(const Vector2D &lower, const Vector2D &upper) const
Checks if this vector is between two other vectors Between means here that when rotating the lower ve...
double y() const
Getter for the y coordinate.
static Vector2D Phi(const double phi)
Constructs a unit vector with azimuth angle equal to phi.
Abstract base class for different kinds of events.