diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2018-10-14 11:42:53 -0400 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2018-10-14 11:42:53 -0400 |
| commit | 8f42378c707c8c962082e394fe67ac3bb5cd557b (patch) | |
| tree | 9b4070c764b8d0ed792d9f79a66fc169a237b949 /CSMath/src/bezier/transforms/geom/TDHPointRotation.java | |
| parent | f778a81e81506a4db455a6f506571c6bba935bf2 (diff) | |
General cleanup
Diffstat (limited to 'CSMath/src/bezier/transforms/geom/TDHPointRotation.java')
| -rw-r--r-- | CSMath/src/bezier/transforms/geom/TDHPointRotation.java | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/CSMath/src/bezier/transforms/geom/TDHPointRotation.java b/CSMath/src/bezier/transforms/geom/TDHPointRotation.java deleted file mode 100644 index bc3c716..0000000 --- a/CSMath/src/bezier/transforms/geom/TDHPointRotation.java +++ /dev/null @@ -1,67 +0,0 @@ -package bezier.transforms.geom;
-
-import bezier.geom.TDHPoint;
-
-public class TDHPointRotation extends TDHRotation {
- public final double x0;
- public final double y0;
-
- public TDHPointRotation(double theta, double x0, double y0) {
- super(theta);
-
- this.x0 = x0;
- this.y0 = y0;
- }
-
- @Override
- public TDHTransformType type() {
- return TDHTransformType.ROTATION;
- }
-
- @Override
- public TDHPoint transform(TDHPoint punkt) {
- double x1 = (punkt.x * Math.cos(theta)) - (punkt.y * Math.sin(theta));
- double y1 = (punkt.x * Math.sin(theta)) - (punkt.y * Math.cos(theta));
-
- double x2 = (-x0 * Math.cos(theta)) + (y0 * Math.sin(theta)) + x0;
- double y2 = (-x0 * Math.sin(theta)) - (y0 * Math.cos(theta)) + y0;
-
- double x = x1 + (punkt.z * x2);
- double y = y1 + (punkt.z * y2);
-
- return new TDHPoint(x, y, punkt.z);
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = super.hashCode();
- long temp;
- temp = Double.doubleToLongBits(x0);
- result = prime * result + (int) (temp ^ (temp >>> 32));
- temp = Double.doubleToLongBits(y0);
- result = prime * result + (int) (temp ^ (temp >>> 32));
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (!super.equals(obj))
- return false;
- if (getClass() != obj.getClass())
- return false;
- TDHPointRotation other = (TDHPointRotation) obj;
- if (Double.doubleToLongBits(x0) != Double.doubleToLongBits(other.x0))
- return false;
- if (Double.doubleToLongBits(y0) != Double.doubleToLongBits(other.y0))
- return false;
- return true;
- }
-
- @Override
- public String toString() {
- return "TDHPointRotation [x0=" + x0 + ", y0=" + y0 + "]";
- }
-}
\ No newline at end of file |
