summaryrefslogtreecommitdiff
path: root/lib/circle_group.h
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2018-10-10 21:45:32 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2018-10-10 21:45:32 -0400
commita43ff1f98e9b9814f858bccb11c174b418458491 (patch)
treeae7e094d914eddb8a1ae9548420ba8c2f329ffae /lib/circle_group.h
parent6e264d243f0b29d90e90b605b6cdeab8227129c9 (diff)
downloadc++-a43ff1f98e9b9814f858bccb11c174b418458491.tar.gz
c++-a43ff1f98e9b9814f858bccb11c174b418458491.tar.bz2
c++-a43ff1f98e9b9814f858bccb11c174b418458491.zip
big rearrangement of files to make libraries and example (research) files clearer, and changed to c++ std lib random numbers
Diffstat (limited to 'lib/circle_group.h')
-rw-r--r--lib/circle_group.h46
1 files changed, 0 insertions, 46 deletions
diff --git a/lib/circle_group.h b/lib/circle_group.h
deleted file mode 100644
index cb7cadd..0000000
--- a/lib/circle_group.h
+++ /dev/null
@@ -1,46 +0,0 @@
-#pragma once
-
-#include "angle.h"
-
-class circle_group_t {
- public:
- bool is_reflection;
- double x;
-
- circle_group_t() : is_reflection(false), x(0) {}
- circle_group_t(bool x, double y) : is_reflection(x), x(y) {}
-
- angle_t act(const angle_t& theta) const {
- if (is_reflection) {
- return angle_t(fmod(2 * M_PI + x - theta.x, 2 * M_PI));
- } else {
- return angle_t(fmod(x + theta.x, 2 * M_PI));
- }
- }
-
- circle_group_t act(const circle_group_t& r) const {
- if (is_reflection) {
- return circle_group_t(!r.is_reflection, fmod(2 * M_PI + x - r.x, 2 * M_PI));
- } else {
- return circle_group_t(r.is_reflection, fmod(x + r.x, 2 * M_PI));
- }
- }
-
- angle_t act_inverse(const angle_t& theta) const {
- if (is_reflection) {
- return act(theta);
- } else {
- return angle_t(fmod(2 * M_PI + theta.x - x, 2 * M_PI));
- }
- }
-
- circle_group_t act_inverse(const circle_group_t& r) const {
- if (is_reflection) {
- return act(r);
- } else {
- return circle_group_t(r.is_reflection, fmod(2 * M_PI + r.x - x, 2 * M_PI));
- }
- }
-};
-
-