Let's say I have to find the least distance between origin and the plane $$x-2y-2z = 3$$
I know distance from origin to any $x-y-z$ plane is $\sqrt{x^2 + y^2 + z^2}$
so the constraint will be $$g(x, y, z) = x - 2y - 2z -3$$
however, what will my $f(x,y,z)$ be? Why is it possible to remove the sqrt and make it such that $$ f(x,y,z) = x^2 + y^2 + z^2? $$