summaryrefslogtreecommitdiff
path: root/CSMath/src/bezier/geom/transform/TDHTransform.java
diff options
context:
space:
mode:
authorbculkin2442 <bjculkin@mix.wvu.edu>2018-05-23 16:42:38 -0400
committerbculkin2442 <bjculkin@mix.wvu.edu>2018-05-23 16:42:38 -0400
commit48f781fb6e61539ba9d17efcfd9f9e38245cf6c0 (patch)
tree97e5743678a00d09024ec040490b8fcf8ccb1c74 /CSMath/src/bezier/geom/transform/TDHTransform.java
parent81d8191c01629d881486f1f1fe5ae16c42b46287 (diff)
Refactor package structure
Diffstat (limited to 'CSMath/src/bezier/geom/transform/TDHTransform.java')
-rw-r--r--CSMath/src/bezier/geom/transform/TDHTransform.java54
1 files changed, 54 insertions, 0 deletions
diff --git a/CSMath/src/bezier/geom/transform/TDHTransform.java b/CSMath/src/bezier/geom/transform/TDHTransform.java
new file mode 100644
index 0000000..cd35caf
--- /dev/null
+++ b/CSMath/src/bezier/geom/transform/TDHTransform.java
@@ -0,0 +1,54 @@
+package bezier.geom.transform;
+
+import bezier.geom.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