How do I transform an object then rename the image to the preimage?

aestberg shared this question 10 months ago
Needs Answer

If I have a polygon, q1, which gets transformed to q1', can I then rename q1' to q1 ?

I have buttons with scripts to do transformations on q1. But the script is written to transform just q1. So if a user transforms once, it becomes q1'. But then to click another button to transform q1', it is written to transform q1.

Please forgive me if I am not being clear.

Comments (7)

photo
1

please, attach a GGB file with the script

photo
1

The idea is to transform the polygon. There is only a script in the TranslateButton and TranslateReadyButton. After the points F,G,and H are translated, the image points should be renamed F,G, and H again so that the script (or another script) could be called to transform F, G, and H again.

(Sorry ahead of time for its clunkiness)

photo
1

Another principle:

Instead of the polygon a free list of free points is transformed in a script.

The polygon is derived from this (transformed) point list

The vertices are derived from the polygon using Vertex().

Thus the names of the objects do not change and the script can be used unchanged for the next transformation.

A simplified example is given in the attachment.

photo
1

Thanks. That's great.

If I try to switch it to translate by a set vector, it still works.

But if I switch to animate, it doesn't work any more. Is that just not possible? (See attached)

photo
1

2 new objects: objPntLst_{old} and d1_{old} (with condition to show)

new: Script in buttonTranslate (= start Animation H)

new: Script in H (Animation objPntLst and End-Animation H)

update: script in buttonReflect

photo
1

Analog:

Animation for Refelect

photo
1

Rami,

It's amazing at how much you are able to simplify the manner to get things done. Your solutions are so clear and efficient. I don't really understand why my ideas don't work, but when I see yours, I throw my crazy method out and use yours.

And I say this not just for my questions, but in reading your answers to so many others, I appreciate how much you do.

Thank!

© 2021 International GeoGebra Institute