Casella di controllo per vincolare e liberare un punto

Giuseppe Pincolini shared this question 1 year ago
Answered

Buongiorno,

ci sto provando da giorni senza successo: vorrei poter muovere liberamente un punto sul piano, ma con la possibilità, tramite una casella di controllo, di vincolarlo all'appartenere a una circonferenza posizionandolo alla minima distanza da dove si trovava prima di clickare sulla casella di controllo.

Si può fare? Grazie in anticipo per qualunque aiuto.

Comments (5)

photo
1

Per favore, posta il tuo file.

photo
1

Questo è il file su cui sto lavorando.

Il punto D deve potersi muovere liberamente quando la casella è deselezionata mentre deve potersi muovere solo sulla circonferenza nascosta c quando la casella è selezionata.

A ogni selezione/deselezione il punto dovrebbe fare il minimo spostamento.

photo
2

Attached is a solution. When the checkbox is checked, D becomes a point on the circle (but stays in the same direction from A as before), and also C moves so that ABCD is a rhombus (which I assumed was also a goal based on the name of the file). This is all handled in the OnUpdate script for the checkbox variable a. There are also two hidden points C' and D' that are temporarily used in the script to calculate the new positions for C and D.

photo
1

Fantastico!

Proprio quello che volevo fare.

Thank you so much

photo
1

Btw, I the point C is still movable even when the checkbox is checked. Wasn't sure what exactly you wanted to happen here. The script would have to be adjusted if you aso want to fix C in this case.

photo
© 2023 International GeoGebra Institute