Commit Graph

14 Commits

Author SHA1 Message Date
Michael Bayne b05258d39e Added test for (now fixed) Area bug. 2013-03-06 11:20:15 -08:00
Michael Bayne fc4cf07ca3 Nixed mirrorAngleOrigin because it's not correct.
The correct way to mirror an angle in [-PI, PI] around the x-axis is simply to
negate it, which doesn't seem ceremonious enough to require a utility method.
2013-02-12 17:27:23 -08:00
Michael Bayne f26a72c26f Change new mirrorAngle to mirrorAngleOrigin, improved javadocs.
The old mirrorAngle mirrors around the "y-axis" (PI/2 or -PI/2 as appropriate)
which is necessary for other code (particularly angularDifference) to work
correctly. The new mirrorAngleOrigin mirrors around the "x-axis" (zero).
2013-02-12 14:24:04 -08:00
Christoph Dietze 0ffabf1419 mirrorAngle(HALF_PI) should be -HALFPI rather than HALF_PI 2013-02-12 22:10:04 +01:00
Michael Bayne 90e0c58c84 Added MathUtil.floorDiv, and tests. 2012-11-28 13:25:44 -08:00
Michael Bayne 485abe95e6 Numerous bits:
- nixed all transforms except identity and affine; the intermediate transforms
were more trouble than they were worth
- fixed bugs in AffineTransform.translate/scaleX/scaleY/rotate; aiya!
- replaced Transform.clone with Transform.copy; deprecated clone
- rewrote transform test in Scala and using Java AffineTransform as a
reference.
2012-07-12 12:25:06 -07:00
Michael Bayne 17b19fe21b Added numerous 3D geometry classes; unabstracted Vector3, Matrix3. 2012-04-29 19:51:38 -07:00
Tim Conkling d2bebff736 Functions for computing the distance between a Point and a Rectangle 2011-12-16 12:35:25 -08:00
Michael Bayne 42d4353788 Various Vector enhancements.
- Moved Vector.direction to Point.direction as that makes more sense. If you
  want to know the angle of the vector between two points, you should do that
  on points, not vectors.

- Added Vector.angle() which returns the angle of the vector (in polar
  coordinates), which matches Vector.length() which returns the magnitude of
  the vector (in polar coordinates).

- Added Vectors.fromPolar to create a vector from polar coordinates, and added
  Vector.setLength and Vector.setAngle to set the one whilst preserving the
  other.
2011-09-02 15:55:05 -07:00
Michael Bayne ffd2f10b24 Changed Vector.mult to Vector.scale and clarified the javadocs.
As Tim points out, vector multiplication implies dot or cross products. These
methods are scaling, not multiplying. Cross product coming in a future commit.
2011-09-02 15:15:06 -07:00
Michael Bayne 1cb8b8bff5 Better error reporting on test failure. 2011-08-05 13:55:57 -07:00
Michael Bayne 1936e20380 Fixed FloatMath.toString(), added tests. 2011-07-29 11:00:20 -07:00
Michael Bayne 1d7ef7cdf7 Added methods to concatenate a translation, rotation or scale directly onto an
existing transform.
2011-07-06 14:13:21 -07:00
Michael Bayne aa0fe0f87c Great big transform revamp.
We now have a Transform interface and a bevy of implementations of varying
generality: identity, rigid body, uniform scaling, non-uniform scaling, and
affine.

Along the way, Vector was added, APIs were tidied up, bits were twiddled, but
no platonic shapes were harmed.
2011-07-06 13:08:12 -07:00