geogebra with kojo

8 views
Skip to first unread message

Lalit Pant

unread,
Sep 20, 2017, 9:39:23 AM9/20/17
to kojo-user, kojo-dev
From the wikidot web based forum:

---
geogebra with kojo
weonkyoung Yu (guest) 20 Sep 2017, 17:51

In gegogebra, constructions and computations can be done using input filed command, ggbscript and javascript.
Can I do the same thing with kojo script

---

Yes, you can programatically control geogebra from Kojo via scala scripts. The bridge is the Mw object in Kojo.

For example, try this script:

Mw.clear()
Mw.hideAlgebraView()
Mw.showAxes()
Mw.variable("m", 1, -5, 5, 0.1, 50, 50)
Mw.variable("c", 0, -2, 2, 0.1, 50, 80)
Mw.evaluate("y = m x + c")

To see more examples, look (in the script editor) at the scripts for Help -> Kojo Overview and Samples -> Math Learning Modules -> Solving Linear Equations (run these scripts, and then search for Mw. in the script editor)

Code completion on the Mw object (type Mw. and then Ctrl+Space) will show you what's available for geogebra interaction.

Or you can look at the Mathworld class (of which the above Mw is an instance) to see what's inside in more detail:
https://github.com/litan/kojo/blob/master/src/main/scala/net/kogics/kojo/mathworld/MathWorld.scala

Hope that helps. Feel free to ask more questions.



Reply all
Reply to author
Forward
0 new messages