1 package tim.prune.function.compress;
4 * Basic class to hold x and y coordinates
5 * for a point or a vector
10 public double x = 0.0, y = 0.0;
24 public XYpoint(double inX, double inY) {
29 * @param inOther other vector
30 * @return scalar dot product
32 public double dot(XYpoint inOther) {
33 return (x * inOther.x + y * inOther.y);
36 /** @return length of vector */
37 public double len() {return Math.sqrt(len2());}
39 /** @return squared length of vector */
40 public double len2() {return (x*x + y*y);}
43 * @param inOther other point object
44 * @return vector from this one to the other one
46 public XYpoint vectorTo(XYpoint inOther) {
47 return new XYpoint(inOther.x - x, inOther.y - y);