# Sliders and values that are crossed

Antoni Gomà shared this question 8 years ago

I wanted to use GeoGebra to find the integer lenghts of the sides of a right triangle with the hypotenuse 2013.

I wanted to do it with the animation of a slider (integer, with limits 0 and 2013 or 1 and 2012).

:( But I found that, in these conditions, the slider does not go through all values.

I've done several tests and I have seen that if I slow the spped, it get more values,... but I need to go very slowly (very, very, very) to slider cross all values.

This is a posisble bug.... or anyone knows a way that really a slider passes all integer values ​​that define the interval?

1

Please post your ggb file to assist us in determining the problem...

Thanks,

Tony

1

Hi,

- with javascript without using the slider :

for (k=0;k<2014;k++)

find the k values.

- second : with lists : version2

https://ggbm.at/559729

1

The problem lies not in the application that I have comment (specifically determine a triangle) but it already happens with a "pure and simple" slider .

I attached two ggb files to shaw it.

In file slider1.ggb is just a slider with animation speed equal 1, unless n = 600 (then speed=0, and slider must stop). By it do not get the value n = 600 [size=50](In addition I can say that not always work the same way. Sometimes it gets n = 600, but the majority of times, it do not get)[/size]

In another file, slider2.ggb, there are just a slider with animation speed 1 and a counter that shows how many values are got by the slider ​​with animation On. You will see that get "many few values".

https://ggbm.at/559715

1

Hi,

If you want close control of the slider then select the slider and use the arrow keys on the keyboard to move it instead of moving it with the mouse.

1

Hi, miir

If you look for the hypotenuse of a right triangle equal 2013 with legs a and b integers should be a ^ 2 + b ^ 2 = 2013 ^ 2 (not 2013). I know that 363, 1980 and 2013 are the sides of this pithagorean triangle. This is not my current problem.

The subject that I put into consideration for the GeoGebra environment is the following:

[size=150]what is the set of values that ​​reaches a slider of integer type with "animation on"? [/size]

(regardless of the problem to which you want to apply)

Hi, M_OLoughlin

I already know very well that by moving the slider "by hand" with the mouse I will not get all the values of the slider.

I also know that moving the slider with the cursor arrow keys, it does get all values. But if the value's interval is long or very long can be very impractical movement "by hand", so I want do it automatically.

For this reason my question is:

it is not possible with "Animation On" (ie automatic movement, made ​​by program, that I would not be very, very slow) that the slider passes all integer values ​​in the range?

If possible as I do?

1

Hi,

Have you tried increasing the "width" of the slider?

Also, holding down the right arrow key gives a reasonable speed.

https://ggbm.at/559719

1

Hi,

Have you tried increasing the "width" of the slider?

Also, holding down the right arrow key gives a reasonable speed.

Yes, I have tried to increase the "width" of the slider and I believe that doing so does not change the amount of numbers through which it passes the slider.

Certainly holding down the right arrow gives a reasonable speed,... but you lose the opportunity (that we have with the automatic movement "animation on") that the slider stops when you reach certain goal. (dition to speed, this is an important reason for using the automatic animation)

Thanks!

1

I confirm. There is a very strange phenomenon with sliders.

Depending on the speed (but it happens already at moderate speed) the slider seems to jump over some of its values.

I checked with a slider value dependent speed command. At a certain value the speed will be set to zero, causing the slider to stop. Sometimes it doesnt stop. Sometimes it stops only on its way back.

The anomalous behaviour is also present in GG 3.2

Please give it a try :P

1

Hi, miir

If you look for the hypotenuse of a right triangle equal 2013 with legs a and b integers should be a ^ 2 + b ^ 2 = 2013 ^ 2 (not 2013). I know that 363, 1980 and 2013 are the sides of this pithagorean triangle. This is not my current problem.

Sorry, may be a bug with the mineral water from Champagne :)

I've corrected.

I add a test for the sliders.

Michel

https://ggbm.at/559731

1

Depending on the speed (but it happens already at moderate speed) the slider seems to jump over some of its values.

This is by design. GeoGebra will try to run the slider at the same speed on a fast or slow computer so values will be skipped as appropriate.

Note: A speed of 1 means that the animation takes about 10 seconds to run once through the interval of the slider.

To get the behaviour you want, make a slider 'a' to run as fast as possible and do this in its On Update scripting tab:

SetValue[b, b+1]

StartAnimation[a, b<100]

The second line will stop the slider again.

https://ggbm.at/559733

1

Thanks Mike.

I can't find where is the error in my file using your way to have the better speed for a (by temp). (the solutions (2013,0),(363,1980),(1980,363) are not added in the file where the script is on the update of the object b)

Works fine with the script on the update of the object temp : 42forumOK

https://ggbm.at/559737

1

Thanks Mike.

I can't find where is the error in my file using your way to have the better speed for a (by temp). (the solutions (2013,0),(363,1980),(1980,363) are not added in the file where the scrip is on the update of the object b)

Works fine with the script on the update of the object temp : 42forumOK

Hi Michel (miir),

I think even you put a "temp" to run the slider ... it not get the value a = 363.

It will be good to use that Mike suggests. Below I write a comment.

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

I also want to say: [size=150]Thanks Mike (murkle)[/size]

I had already seen the manual item about "10 seconds" to run a slider... but I thought it would turn faster, do not think we need to skip values.

However, the solution to make a cunter instead of a slider, so make sure that get all values ​​is very interesting. Thank you, teacher!

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

You can see the "Christmas card" that generated my headache with sliders.

There, I arraged it (knowing beforehand the solution) with a step of 11 for the slider (instead of step 1).

At the first page you can search "by hand" with two sliders the legs of a pithagorean triangle of hypotenuse 2013.

If you fancy a break "Que experimenti el GeoGebra" (GeoGebra will try to find the solution)

So you move on to another page where you find the "famous" slider

"Engega o continua" means "Start or continue"

Bones festes --> Merry Christmas

Joiós any 2013 --> A Happy new year

1

Hi Michel (miir),

I think even you put a "temp" to run the slider ... it not get the value a = 363.

It will be good to use that Mike suggests.

it's what I've done, just renaming the objects, the value 363 is get.

1

Hi,

There is still a problem.

In miir's file (42forum) a is still skipping values in Algebra View.

I think it may have to do with the way On Update works.

In this modified file I tried this experiment:

Remove the min and max values in the Slider tab of a.

In the Slider tab of temp change the min value and press enter.

Notice that a in Algebra View increments twice!

However if you change the min value and then just click in the max value box a increments once only.

The same thing happens in 42forumOK with the variable n

https://ggbm.at/559743

1

skipping values in Algebra View

In GeoGebra 4.2, the Algebra View doesn't update as often (to make everything else run faster :) )