This is the class the determinate the position of the circle. The ball has initially a position, when we click on the screen, we should tell to the ball that the pointed clicked on the screen is the new position.
void ofApp::mouseReleased(int x, int y, int button){
circles.setNewPosition(ofVec2f(x,y));
}
The way in which this ball moves towards the new direction can be defined by the easing functions. In openFrameworks there is a nice addon that take care of this part, https://github.com/arturoc/ofxEasing
Look at the example, and you will able to figure out how to adapt that code to the ball example in processing