当前位置:网站首页>Geogebra instance clock

Geogebra instance clock

2022-06-24 09:52:00 Gigi Princess

In this example, I followed b Standing on a video , This is a link :

[ Learn to use ] Geogebra The clock _ Bili, Bili _bilibili

One 、 Set profile

First draw a circle , Set the radius first 、 center of a circle , Then draw a circle

cR=5
O=(0,0)
cO=Circle(O,cR)

Then set the scale marks on the disc

Hour hand 、 Minute hand and second hand scale lines need to be distinguished , First, draw a dot on the circle , Then draw the tick marks

mPs=Sequence((cR;pi/2-pi/30*k),k,1,60)
mSs=Sequence(Segment(mps(k),0.95*mPs(k)),k,0,60)
hSs=Sequence(Segment(mPs(k),0.9*mPs(k)),k,5,60,5)

The text part , Clock number 1~12

hTs=Sequence(Text(k,0.8*mPs(5*k)-(0.3,0.3)),k,1,12)

Then draw the pointer

h=Slider(0,24,1)

m=Slider(0,60,1)

s=Slider(0,60,1)

Set pointer length

hR=2
mR=3
sR=4

Set the angle

sA=pi/2-s/60*2*pi
vS=Vector(0,0+(sR;sA))
mA=pi/2-(m*60+s)/60*60*2*pi
vM=Vector(0,0+(mR;mA))
hA=pi/2-(h*60*60+m*60+s)/12*60*60*2*pi
vH=Vector(0,0+(hR;hA))

Next, you can set the pointer to your favorite color

Two 、 Animate

Turn the hour hand 、 Minute and second hands are set to rotate automatically , Set up two sliders , Speed and time ,v It's speed ,t Is time

v=Slider(1,120,1)
t=Slider(0,24*60*60,1,v/(8640))

There are now two forms , The first is through t To change s、m、h Value

SetValue(s,Mod(t,60))
SetValue(m,Mod(floor(t/60),60))
SetValue(h,Mod(floor(t/3600),24))

The second form is through s、m、h change t Value

First, change the progress bar so that s、m、h It can be downloaded from 60 Continue dragging to automatically jump to 0

Change script directly , In the right-click attribute

s Script :

SetValue(t,Mod(t+1,86400))
SetValue(s,Mod(s+1,60))
SetValue(m,Mod(floor(t/60),60))
SetValue(h,Mod(floor(t/3600),24))

m Script :

SetValue(t,Mod(t+60,86400))
SetValue(s,Mod(s+1,60))
SetValue(m,Mod(floor(t/60),60))
SetValue(h,Mod(floor(t/3600),24))

h Script :

SetValue(t,Mod(t+3600,86400))
SetValue(s,Mod(s+1,60))
SetValue(m,Mod(floor(t/60),60))
SetValue(h,Mod(floor(t/3600),24))

Next , Add a button : start-up 、 stop it 、 Now the time button

start-up Script :

StartAnimation(t,True)

stop it Script :

StartAnimation(t,False)
StartAnimation(h,False)
StartAnimation(m,False)
StartAnimation(s,False)

present time Script :

ST= The system time is in ()
SetValue(t,ST(4)*3600+ST(3)*60+ST(2))

Next, add a screen

Add text setting script :

floor(h/10)  The rest of the formula (h,10) : floor(m/10)  The rest of the formula (m,10) : floor(s/10)  The rest of the formula (s,10) 

That's about it , The following figure shows the clock I set , Click the current time to update the time to the current time

原网站

版权声明
本文为[Gigi Princess]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/175/202206240850377679.html