say for instance, I have a canvas and I would like to click on 2 distinct points,
How would I code it in such a way, that when I click on a point once, it will save it, and then when I clicked on another point again, it will then show the x-y coordinate and give me the distance between the 2 given points.
Also, say for instance I would like to restrict this two points where the x-value should fall within -200 < x < 200
anybody? do I need to use list or a forever loop when presenting this?
Thank you!
Offline
You can find the distance with this rather long equation:
(click for full size)
You need variables to save the locations.
Offline
but how would you save the previous click?
I would also like to restict these points within -200 <x < 200 of the canvas, so when I click outside this x-coordinate, it will come up as an error, rather than recording it as the first or second point
Offline