So I've written a constraint for keeping an object at a fixed distance from a fixed point,you can call circular constraint (it is in 2D), so the math equation for this is : (x-2)^2+(y-2^2)=1,assuming the fixed point coords are (2,2) and the fixed distance is 1,anyway when I differentiate it , it removes the constant which is very important for the constraint , and once I apply it, it assumes that the fixed distance is the distance from my object and the fixed point , here is the solver,I'm using a very basic form since it's a single object in 2D, So how do I solve that out?!
float lambda = -mass*((velocity.x * (2 * centroid.x - 4) + velocity.y * (2 * centroid.y - 4)) / ((2 * centroid.x - 4) * (2 * centroid.x - 4)+(2*centroid.y-4)*(2*centroid.y-4)));
vec2 deltaVelo;
deltaVelo.x = (lambda * (2 * centroid.x - 4)) / mass;
deltaVelo.y = (lambda * (2 * centroid.y - 4)) / mass;
velocity += deltaVelo;