Script that takes 3 inputs and generates object

Georgios Anthitsis shared this question 2 years ago
Answered

Hello


I posted this on reddit, but nobody answered there. I'd like to create a worksheet that contains rectangles and a script that shears them. The user should be able to do the following with the script:

  1. Choose the polygon to shear by entering its name.

  2. Choose the invariant side of the polygon by entering its end points.

  3. Choose the shear factor with a slider (so that he can see the effect of different shear factors in real time and choose the appropriate value).

  4. Press enter to output the transformed polygon (which can then be manipulated further).


Do you have any ideas on how to do that? I have some basic programming experience with python but I've never used javascript.


Thanks!

Comments (1)

photo
1

What you want does not make sense in this form, since it is not possible or extremely effortful.

The main problem is that GGB works primarily deterministically. As soon as the user is supposed to independently create new (geometric) objects that interact with existing (or future) objects, then it becomes complex and extensive.

Attached is an (simplified) example of an alternative. All objects and dependencies already exist with the start of the applet. However, the objects are modifiable. Any scripts are not required.

Comments have been locked on this page!

© 2023 International GeoGebra Institute