Snap B to Set of Points

steponic shared this question 4 years ago
Answered

Dear Hive Mind:


I'm trying to create a vector that moves only in 15 degree increments AND is adjustable in length.


The 15 degree points are defined in VPoints, shown by the green points.


Is there any way to Snap Point B to the set of green points only?


I created a vector where the points snap fine by moving Point B and the length is adjustable by a separate slider. But I'd prefer that both of those events happen just by moving Point B.


Cheers,


Russ

Comments (5)

photo
2

the trick: dynamiccoords()

Files: foro.ggb
photo
1

Sweet! Thanks for the fix! I've seen you mention dynamiccoords() before. I think I need to learn more about this. Can you point me to some tutorials or documentation beyond the GGB Manual?

photo
1

Not, sorry

when you need a circular definition (in this case the list is generated by B and B must be in list) the dynamiccoords are the solution.

a new point C is defined (this avoid circular definitions). when C is moved really B is selected, moved to C and you really move B in hide mode but you see C

photo
1

If you do not mind that your point A is at the origin of the coordinate system, you can also change the grid to polar and set the option of "fix to grid". This of course can affect the other parts of your construction, but this can also solve the issue of moving a point to only specific places.

photo
2

A little scripting ( :( ) to make it work better when you drag A


https://www.geogebra.org/m/wf6a36ak

© 2023 International GeoGebra Institute