Pixels To Yards?

Hi, there all

I got a golf course image and on top of this image are to small image-dots
which represent point A and point B; these are draggable and a doted-line is drawn between each other, this could be interesting when the user position one dot from any point of interest and the other on the green, to know the distance in yadrs from thos two points… My question is this:

How can I transform the X and Y between this to points into Yards?
Any ideas?

Thanks in Advance

well u gotta know how many pixels there are in a yard and then just do
yards = pixels*yard
where “yard” is the length of one yard in pixels

Something like:
xlenght = pointA._x - pointB._x;
ylenght = pointA._y - pointB._y;
lenght = Math.sqrt(Math.abs(Math.pow(xlenght,2) + Math.pow(ylenght,2)));
yards = lenght/yard; \ almost as siko sugested … but you should divide with the number of pixels a yard has

Hope it works.