Finding the distance based off coordinates

40 Views Asked by At

Basically, I have a camera that gives me the (x , y) coordinates of an object. I need to figure out the distance from the camera to the object based on these coordinates. Is there a way to do so? (the camera is fixed on a moving robot. so the camera's coordinates are always varying.)

1

There are 1 best solutions below

0
On

Yes. Assuming your camera is located in the origin of a Cartesian coordinate system, the distance is given by $\sqrt{x^2+y^2}$. If your camera is located at a point $(a,b)$, then the distance is $\sqrt{(x-a)^2+(y-b)^2}$.