I have no good solution for the last problem in this challenge

rami shared this question 7 months ago
Answered

1.) For all points with the prefix B and the sufix "_{nn}" a list should be created (dependet on points)

2.) Based on the above list, for a given point (A) with each list element a vector is to be created in an (additional) list.

3.) Points "B_{nn}" are to be

- additionally created

- renamed

- deleted

- moved

and the lists from point 1) and point 2) should be updated automatically.

The applet should be able to save and open again without problems.

The order within the construction protocol for the points B_{nn} should not have an influence in creating the list from point 1).

---------------------

All the above requirements are fulfilled except for deletion of a point B_{nn}

A solution is sought (possibly a very detailed error analysis)

Best Answer
photo

Is the naming important? You could do this to solve the deleting problem:

* l1=A1:A100

* Polynomial(l1)

* rename each new point to eg A5

Comments (20)

photo
1

Please explain what problem you are trying to solve overall

photo
1

I am looking for a general solution to extend point lists automatically.

The extension is done for points with a certain name and a following index.

The points list always contains the current values of his points.

photo
1

general solution to extend point lists automatically.

Why? To achieve what?

photo
1

Example:

There is a polynomial with some points. The points have the names P_{1}...P_{nn}. A point P_{33} is created. The above functionality automatically extends the list needed for the polynomial.

If you do not consider the task to be meaningful (which I suspect you do), then I will tolerate your judgment (even without justification) without any problems.

photo
1

How's that? https://www.geogebra.org/m/yar3rngq


You can add in a check for the point name being P_{xx}

photo
1

Many thanks for the approach.

With JS it is easier to add to the point list. But that is not my problem.

Also in your version, deleting a point will delete the dependency (in this case the function). In your version, the list is also deleted (probably in mine too, but it is rebuilt immediately)

It might be helpful if you could mark a deletion, then update the list and finally really delete the item.

photo
1

Is the naming important? You could do this to solve the deleting problem:

* l1=A1:A100

* Polynomial(l1)

* rename each new point to eg A5

photo
1

good idea!, Thanks.

I will try the spreadsheet.

photo
1

@ Michael Borcherds Your example doesn't work in the desktop version: 5.0.574. 0_d (Java 1.8.0:161-32bit, 247MB CAS)

photo
1

yes, because registerADDlistener JS method only works online (see global Javascript in the file)

photo
1

desktop version: 5.0.574.0
That's really old - please upgrade :)


@jumera check v612 :)

https://wiki.geogebra.org/e...

photo
2

@Michael : doesn't work with GG5v613 and GGB6v609 (on Mac)

@mathmagic : your file works fine offline ! (all files i did with listener before only work online)

why your file works and Michael's file doesn't work ?

photo
1

@ Michael Borcherds -your example doesn't load in 5.0.613 and GeoGebra_6\app-6.0.609

photo
1

This one works for me in v613. Does it work for you?

photo
1

yes

your material-ysv8g5v7 works too now

but it didn't work before (i put the old one)


Edit : was problem line 23 ) instead of });

photo
1

Anyway, thank's

I learned that listener works offline (is it a new feature or it has always work offline ?)

photo
1

They've always worked offline (but only passing the function name as a string). Now both ways work :)

photo
1

ok

(but only passing the function name as a string)


I didn't do that

Thank's

photo
1

Thank you, now the applet works without problems in both versions!

photo
© 2021 International GeoGebra Institute