Code example for Point

Methods: set

    private Point getValidPuckPosition(Point current_position){
        Point pointer = new Point(current_position);
        Point wheel_center = this.wheel.getPosition();
        Point adj_pointer = new Point(pointer);
        //Set the puck position to within the bounds of the wheel 
        if(pointer.x != wheel_center.x || pointer.y != wheel_center.y){
            //reset the drive coords to be the zeroed pointer coords 
            adj_pointer.set(pointer.x, pointer.y);
            //Use the wheel center to zero the pointer coords 
            adj_pointer.x = adj_pointer.x - wheel_center.x;
            adj_pointer.y = adj_pointer.y - wheel_center.y;
            double a = Math.abs(adj_pointer.y);
            double b = Math.abs(adj_pointer.x);
Stop searching for code, let great code find you!  Add Codota to your java IDE