summaryrefslogtreecommitdiff
path: root/CSMath/src/bezier/transforms/TDHTransform.java
diff options
context:
space:
mode:
authorbjculkin <bjculkin@BECK-DZ9BJB2.wvu-ad.wvu.edu>2018-04-11 15:29:25 -0400
committerbjculkin <bjculkin@BECK-DZ9BJB2.wvu-ad.wvu.edu>2018-04-11 15:29:25 -0400
commitdcb6c2159446135a142cad41eec185bb24c45bfb (patch)
tree965dcc07fc0256a9a8254d5f968e316a1e928617 /CSMath/src/bezier/transforms/TDHTransform.java
parent8ecf52b6c5821e5c3de8a0f5c9e7ed3e357cb282 (diff)
Split #9 into one class/file
Diffstat (limited to 'CSMath/src/bezier/transforms/TDHTransform.java')
-rw-r--r--CSMath/src/bezier/transforms/TDHTransform.java54
1 files changed, 54 insertions, 0 deletions
diff --git a/CSMath/src/bezier/transforms/TDHTransform.java b/CSMath/src/bezier/transforms/TDHTransform.java
new file mode 100644
index 0000000..48f60a5
--- /dev/null
+++ b/CSMath/src/bezier/transforms/TDHTransform.java
@@ -0,0 +1,54 @@
+package bezier.transforms;
+
+import bezier.TDHPoint;
+
+/**
+ * Transformation applicable to TDHPoints.
+ *
+ * @author bjculkin
+ *
+ */
+@FunctionalInterface
+public interface TDHTransform {
+ /**
+ * Get the type of this transform.
+ *
+ * Unknown transformations are assumed to be identity transforms.
+ *
+ * @return The type of this transform.
+ */
+ default TDHTransformType type() {
+ return TDHTransformType.IDENTITY;
+ }
+
+ /**
+ * Get the matrix representation of the transform.
+ *
+ * Unknown transformations are assumed to be identity transforms.
+ *
+ * @return The matrix representation of the transform.
+ */
+ default double[][] matrix() {
+ return new double[][] { new double[] { 1, 0, 0 }, new double[] { 0, 1, 0 }, new double[] { 0, 0, 1 } };
+ }
+
+ /**
+ * Get the inverse of the transform.
+ *
+ * Unknown transformations are assumed to be identity transforms.
+ *
+ * @return The inverse the transform.
+ */
+ default TDHTransform invert() {
+ return new TDHIdentity();
+ }
+
+ /**
+ * Apply the transform to a point.
+ *
+ * @param punkt
+ * The point to transform.
+ * @return A transformed version of the point.
+ */
+ TDHPoint transform(TDHPoint punkt);
+} \ No newline at end of file