summaryrefslogtreecommitdiff
path: root/sim/src/Point.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sim/src/Point.cpp')
-rw-r--r--sim/src/Point.cpp72
1 files changed, 0 insertions, 72 deletions
diff --git a/sim/src/Point.cpp b/sim/src/Point.cpp
deleted file mode 100644
index 1f49774..0000000
--- a/sim/src/Point.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-#include <kurator/sim/Point.h>
-
-#include <cmath>
-
-
-namespace kurator
-{
-namespace sim
-{
-
-
-double
-Point::magnitude() const
-{
- return std::sqrt(std::pow(x, 2) + std::pow(y, 2));
-}
-
-
-double
-Point::distance(const Point& other) const
-{
- return std::sqrt(std::pow(other.x - x, 2) + std::pow(other.y - y, 2));
-}
-
-
-double
-Point::angle() const
-{
- return std::atan2(y, x); // (+x, _) is 0
-}
-
-
-Point
-Point::rotate(const double angle) const
-{
- return {
- x * std::cos(angle) - y * std::sin(angle),
- x * std::sin(angle) + y * std::cos(angle),
- };
-}
-
-
-Point
-Point::scale(const double _scale) const
-{
- return {x * _scale, y * _scale};
-}
-
-
-Point
-Point::normalized() const
-{
- return scale(1.0 / magnitude());
-}
-
-
-Point
-Point::operator-(const Point& other) const
-{
- return {x - other.x, y - other.y};
-}
-
-
-Point
-Point::operator+(const Point& other) const
-{
- return {x + other.x, y + other.y};
-}
-
-
-} // namespace sim
-} // namespace kurator