I am struggling with Manipulate
dynamic updating. I would like to have an image containing two points which can both be moved in real time to any location on the image EXCEPT if the distance between them becomes smaller than a given value.
The difficulty is that I do not want to be able to move them to a position where their distance is smaller than this value and then disable the sliders, like I have done below. I would like the slider to not enable me to go to the forbidden locations in the first place.
Please find my code below.
Manipulate[
pt1 = {x1, y1};
pt2 = {x2, y2};
dist = N[EuclideanDistance[pt1, pt2]];
Graphics[{Point[pt1], Point[pt1]}],
{{x1, 0}, -5, 5, Enabled -> Dynamic[dist > 2]},
{{y1, 0}, -5, 5, Enabled -> Dynamic[dist > 2]},
{{x2, 2}, -5, 5, Enabled -> Dynamic[dist > 2]},
{{y2, 2}, -5, 5, Enabled -> Dynamic[dist > 2]}]
Your help would be very much appreciated. Thank you in advance. Ella