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?
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