# How to Generate a new Point every time (In Button)

Tanmay shared this question 2 years ago

In the File Below,

There are three points and the button just generates a random integer between 0 and 2.

The Button also looks if the Random Integer is 0, then it sets Point S to the Average of A and S.

if it is 1 It sets Point S to the Average of B and S

else (It means if the Random Number is 2) Point S will be the Average of C and S.

It is all working, but my question is, how can you every time you click the Button, Generate a new Point which has those Coordinates.

Example:

First I will look at the average of S and set S1 to it.

Then I will look at the average of S1 and set S2 to it, exc.

It would be good to do that in the Spreadsheet which comes with GeoGebra. if you do not really want the point you can select trace on for S

if you want new points use if(...............) instead S=if(.....................) in script 2

if you do not really want the point you can select trace on for S

if you want new points use if(...............) instead S=if(.....................) in script