im using this code

camera.x = player.x - (cos(camera.pan+20) * camera_dist);
camera.y = player.y - (sin(camera.pan+20) * camera_dist);

to rotate the camera around the character, but as i rotate the character does a jittery jerking motion
is there anyway to smooth this action out?