public void update(double timestep) {
		if (this.state.equals("flipping")){
			if(endPoint.getCenter().x()==flippedSpot.getCenter().x() && endPoint.getCenter().y()==flippedSpot.getCenter().y()){ //we are already in the flipped position
				state = "flipped";
			} else {
				double deltaAngle = timestep*angularVelocity;
				double timeUntilStationary = Geometry.timeUntilRotatingCircleCollision(endPoint, pivot.getCenter(), angularVelocity, flippedSpot, new Vect(0,0));
				if (timestep>=timeUntilStationary){ //we will stop rotating during the timestep
					endPoint = new Circle(flippedSpot.getCenter().x(), flippedSpot.getCenter().y(), 0.0);
					flipper = new LineSegment(flippedFlipper.p1().x(), flippedFlipper.p1().y(), flippedFlipper.p2().x(), flippedFlipper.p2().y());
					state = "flipped";
				} else {
					endPoint = Geometry.rotateAround(endPoint, pivot.getCenter(), new Angle(deltaAngle));
					flipper = Geometry.rotateAround(flipper, pivot.getCenter(), new Angle(deltaAngle));
				}
			}
		} else if (this.state.equals("deflipping")){
			if(endPoint.getCenter().x()==initialSpot.getCenter().x() && endPoint.getCenter().y()==initialSpot.getCenter().y()){ //we are already in the initial position
				state = "initial";
			} else {
				double deltaAngle = timestep*(-1)*angularVelocity;
				double timeUntilStationary = Geometry.timeUntilRotatingCircleCollision(endPoint, pivot.getCenter(), -angularVelocity, initialSpot, new Vect(0,0));
				if (timestep>=timeUntilStationary){ //we will stop rotating during the timestep
					endPoint = new Circle(initialSpot.getCenter().x(), initialSpot.getCenter().y(), 0.0);
					flipper = new LineSegment(initialFlipper.p1().x(), initialFlipper.p1().y(), initialFlipper.p2().x(), initialFlipper.p2().y());
					state="initial";
				} else {
					endPoint = Geometry.rotateAround(endPoint, pivot.getCenter(), new Angle(deltaAngle));
					flipper = Geometry.rotateAround(flipper, pivot.getCenter(), new Angle(deltaAngle));
				}
			}
		}
		double pivotX = pivot.getCenter().x();
		double pivotY = pivot.getCenter().y();
		double initX = initialSpot.getCenter().x();
		double initY = initialSpot.getCenter().y();
		double endX = endPoint.getCenter().x();
		double endY = endPoint.getCenter().y();
		Vect initVect = new Vect(initX-pivotX, initY-pivotY);
		Vect endVect = new Vect(endX-pivotX, endY-pivotY);
		Angle initAngle = initVect.angle();
		Angle endAngle = endVect.angle();
		double currentAngle = Math.abs((endAngle.minus(initAngle)).radians());
		if (currentAngle>Math.PI/2){
			currentAngle = Math.PI*2-currentAngle;
		}
		this.currentAngle = (-1)*currentAngle;
	}