Geometrical optics

When using newton's formula f^2=xy is it always valid for all x and y? Do we consider the formula with magnitude of x and y?


@asthareddy the pic mentions x and y as distances so they are to be taken as +ve right?