LoginSignup
0
0

More than 3 years have passed since last update.

【GeoGebra】jsによって値を変更する

Posted at

値を変更するコマンドSetValue

GeoGebraでは、値を変更する方法としてスライダーを用いる方法の他にSetValue(変数名,値)コマンドを用いる方法があります。使い方としては、ツールバーからボタンを配置し、スクリプトに記述します。

SetValue(α,1)

スクリーンショット 2021-03-31 9.57.14.jpg
余談ですがGeoGebraでαはoption+Aで打てます。

GeoGebra ScriptではなくJavaScriptで記述する場合

複雑なアプリを作成するとなると、jsで記述しなければならないこともしばしば。そんな時はggbApplet.evalCommand()内に処理を入れます。

ggbApplet.evalCommand('SetValue(α,1)');

スクリーンショット 2021-03-31 10.02.09.jpg

これでjsからGeoGebraの変数の値を変更することができました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0