diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2018-05-23 16:42:38 -0400 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2018-05-23 16:42:38 -0400 |
| commit | 48f781fb6e61539ba9d17efcfd9f9e38245cf6c0 (patch) | |
| tree | 97e5743678a00d09024ec040490b8fcf8ccb1c74 /CSMath/src/bezier/transforms/TDHTranslate.java | |
| parent | 81d8191c01629d881486f1f1fe5ae16c42b46287 (diff) | |
Refactor package structure
Diffstat (limited to 'CSMath/src/bezier/transforms/TDHTranslate.java')
| -rw-r--r-- | CSMath/src/bezier/transforms/TDHTranslate.java | 89 |
1 files changed, 0 insertions, 89 deletions
diff --git a/CSMath/src/bezier/transforms/TDHTranslate.java b/CSMath/src/bezier/transforms/TDHTranslate.java deleted file mode 100644 index 3d2afe9..0000000 --- a/CSMath/src/bezier/transforms/TDHTranslate.java +++ /dev/null @@ -1,89 +0,0 @@ -package bezier.transforms;
-
-import bezier.geom.TDHPoint;
-
-/**
- * A transform that does coordinate translation.
- *
- * @author bjculkin
- *
- */
-public class TDHTranslate implements TDHTransform {
- /**
- * The amount to translate the x-coordinate by.
- */
- public final double h;
- /**
- * The amount to translate the y-coordinate by.
- */
- public final double k;
-
- /**
- * Create a new translation transform.
- *
- * @param h
- * The amount to translate x by.
- * @param k
- * The amount to translate y by.
- */
- public TDHTranslate(double h, double k) {
- this.h = h;
- this.k = k;
- }
-
- @Override
- public TDHTransformType type() {
- return TDHTransformType.TRANSLATE;
- }
-
- @Override
- public TDHPoint transform(TDHPoint punkt) {
- double x = punkt.x + (punkt.z * h);
- double y = punkt.y + (punkt.z * k);
-
- return new TDHPoint(x, y, punkt.z);
- }
-
- @Override
- public double[][] matrix() {
- return new double[][] { new double[] { 1, 0, 0 }, new double[] { 0, 1, 0 }, new double[] { h, k, 1 } };
- }
-
- @Override
- public TDHTransform invert() {
- return new TDHTranslate(-h, -k);
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- long temp;
- temp = Double.doubleToLongBits(h);
- result = prime * result + (int) (temp ^ (temp >>> 32));
- temp = Double.doubleToLongBits(k);
- result = prime * result + (int) (temp ^ (temp >>> 32));
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- TDHTranslate other = (TDHTranslate) obj;
- if (Double.doubleToLongBits(h) != Double.doubleToLongBits(other.h))
- return false;
- if (Double.doubleToLongBits(k) != Double.doubleToLongBits(other.k))
- return false;
- return true;
- }
-
- @Override
- public String toString() {
- return "TDHTranslate [h=" + h + ", k=" + k + "]";
- }
-}
\ No newline at end of file |
