LoginSignup
0
0

More than 3 years have passed since last update.

JavaScriptによるオブジェクトの配置【GeoGebra】

Posted at

ボタンを配置する

ツールからボタンを配置し、タイトルのみを入力します。
スクリーンショット 2021-02-02 13.35.32.jpg

ボタンが押下された時の処理を記述する

言語をGeoGebra ScriptからJavaScriptに変更します。
スクリーンショット 2021-02-02 13.38.47.jpg
クリックしてのところに処理を記述します。

ggbApplet.evalCommand('(0,0)');

そしてボタンを押すと
スクリーンショット 2021-02-02 13.42.36.jpg
A = (0,0)が配置されました。

なお、オブジェクトの名前を指定したいときは

ggbApplet.evalCommand('B = (0,0)');

のように書きます。ボタンを押すたびに次々とオブジェクトが追加されてしまう現象は、オブジェクトに名前をつけることで回避できます。

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