/** * 2D vector class by subpixel (http://subpixels.com) *

Last modified: 2009-01-09 10:47

*/ class Vector2D { public float x; public float y; public Vector2D() { x = 0; y = 0; } public Vector2D(Vector2D v) { x = v.x; y = v.y; } public Vector2D(float x, float y) { this.x = x; this.y = y; } public Vector2D add(Vector2D other) { return new Vector2D(this.x + other.x, this.y + other.y); } public String str() { return "(" + x + "," + y + ")"; } }