当前位置:网站首页>GeoGebra 实例 时钟
GeoGebra 实例 时钟
2022-06-24 09:32:00 【Gigi Princess】
这个实例我是跟着b站一个视频做的,这是链接:
[学用] Geogebra 时钟_哔哩哔哩_bilibili
一、设置外形
首先要画一个圆形,先设置半径、圆心,然后画圆
cR=5
O=(0,0)
cO=Circle(O,cR)
然后设置圆盘上的刻度线
时针、分针和秒针刻度线需要区分,首先在圆上描点,然后绘制刻度线
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)文字部分,时钟数字1~12
hTs=Sequence(Text(k,0.8*mPs(5*k)-(0.3,0.3)),k,1,12)接着绘画指针
h=Slider(0,24,1)
m=Slider(0,60,1)
s=Slider(0,60,1)设置指针长度
hR=2
mR=3
sR=4设置角度
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))接下来可以将指针设置为自己喜欢的颜色
二、设置动画
将时针、分针和秒针设置为自动转动,设置两个滑动条,速度和时间,v是速度,t是时间
v=Slider(1,120,1)
t=Slider(0,24*60*60,1,v/(8640))现在有两种形式,第一种是通过t来改变s、m、h的值
SetValue(s,Mod(t,60))
SetValue(m,Mod(floor(t/60),60))
SetValue(h,Mod(floor(t/3600),24))第二种形式是通过s、m、h改变t的值
首先要改变进度条让s、m、h可以从60继续拖动自动跳到0
直接更改脚本,在右键属性里
s 脚本:
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脚本:
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脚本:
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))接下来,添加按钮:启动、停止、现在时间按钮
启动 脚本:
StartAnimation(t,True)停止 脚本:
StartAnimation(t,False)
StartAnimation(h,False)
StartAnimation(m,False)
StartAnimation(s,False)现在时间 脚本:
ST=系统时间在()
SetValue(t,ST(4)*3600+ST(3)*60+ST(2))接下来添加屏幕
添加文本设置脚本:
floor(h/10) 余式(h,10) : floor(m/10) 余式(m,10) : floor(s/10) 余式(s,10) 差不多就这些,下图是我设置的时钟,点击现在时间就可以将时间更新到当前时间

边栏推荐
- 关于thinkphp5 使用模型save()更新数据提示 method not exist:think\db\Query-> 报错解决方案
- 深度学习论文阅读目标检测篇(七)中英对照版:YOLOv4《Optimal Speed and Accuracy of Object Detection》
- 5分钟,客服聊天处理技巧,炉火纯青
- 198. house raiding
- 文献调研报告
- Event registration Apache pulsar x kubesphere online meetup hot registration
- JCIM|药物发现中基于AI的蛋白质结构预测:影响和挑战
- leetcode--字符串
- [Eureka source code analysis]
- 算法--找到和最大的长度为 K 的子序列(Kotlin)
猜你喜欢

PRCT-1400 : 未能执行 getcrshome解决方法

Servlet fast foundation building

Handling method of Oracle data file header SCN inconsistency

Five heart matchmaker

Literature Research Report

Summary of medical image open source datasets (II)

关于thinkphp5 使用模型save()更新数据提示 method not exist:think\db\Query-> 报错解决方案

《MATLAB 神经网络43个案例分析》:第32章 小波神经网络的时间序列预测——短时交通流量预测

Talking about the knowledge of digital transformation

The ambition of JD instant retailing from 618
随机推荐
Time series data augmentation for deep learning: paper reading of a survey
Baidu AI template for knowledge understanding
每周推薦短視頻:談論“元宇宙”要有嚴肅認真的態度
20、 Processor scheduling (RR time slice rotation, mlfq multi-level feedback queue, CFS fully fair scheduler, priority reversal; multiprocessor scheduling)
关于thinkphp5 使用模型save()更新数据提示 method not exist:think\db\Query-> 报错解决方案
从618看京东即时零售的野心
Go language project development practice directory
获取带参数的微信小程序二维码-以及修改二维码LOGO源码分享
Weekly recommended short video: is the ultimate form of computing "meta universe"?
[custom endpoint and implementation principle]
[GDB debugging tool] | how to debug under multithreading, multiprocessing and running programs
Detailed explanation of ThinkPHP 5.0 Model Association
算法--找到和最大的长度为 K 的子序列(Kotlin)
如何让社交媒体成为跨境电商驱动力?这款独立站工具不能错过!
PHP封装一个文件上传类(支持单文件多文件上传)
e的lnx为什么等于x
每周推荐短视频:计算的终极形态是“元宇宙”?
leetcode--字符串
June 13-19, 2022 AI industry weekly (issue 102): career development
Oracle database listening file configuration