public void PremulAndSetInto(BuffPoint2d p) { double x = p.getX() * getM00() + p.getY() * getM10() + getM20(); double y = p.getX() * getM01() + p.getY() * getM11() + getM21(); double z = p.getX() * getM02() + p.getY() * getM12() + getM22(); p.set(x / z, y / z); }
public Point2d Premul(BuffPoint2d p) { double x = p.getX() * getM00() + p.getY() * getM10() + getM20(); double y = p.getX() * getM01() + p.getY() * getM11() + getM21(); double z = p.getX() * getM02() + p.getY() * getM12() + getM22(); return(new Point2d(x / z, y / z)); }
public void PremulAndSetInto(BuffPoint2 p) { if (p is BuffVector2d) { this.PremulAndSetInto((BuffPoint2d)p); } else { BuffPoint2d _p = new BuffPoint2d(p); this.PremulAndSetInto(_p); _p.getInto(p); } }
public double getDistanceL1(BuffPoint2d other) { return(Math.Abs(other.getX() - getX()) + Math.Abs(other.getY() - getY())); }
public double getDistanceCuad(BuffPoint2d other) { return(Square(other.getX() - getX()) + Square(other.getY() - getY())); }
public double getDistance(BuffPoint2d other) { return(Math.sqrt(getDistanceCuad(other))); }