public static Observation vectorToObservation(Vector2D v, bool isOccupied, Vector2D rbotPos, double rbotAngle, int unitLength, int certainty) { v.rotate(rbotAngle - 90); v.translate(rbotPos); v.scale(1.0 / unitLength); return new Observation((int)v.getX(), (int)v.getY(), isOccupied, certainty); }
public void translate(Vector2D v) { x = x + v.getX(); y = y + v.getY(); }