User Tools

Site Tools


blog:2020-11-08:geogebra_plugin

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
blog:2020-11-08:geogebra_plugin [2020/11/08 09:23] va7fiblog:2020-11-08:geogebra_plugin [2021/01/03 08:08] (current) va7fi
Line 1: Line 1:
 ====== Geogebra Plugin ====== ====== Geogebra Plugin ======
-[[https://www.geogebra.org/ |Geogebra]] is a graphing and geometry tool I've been using since my teaching days.  I always found it to be very useful to display concepts that are hard to visualize on a static page.  It is a lot more than a simple animation since people can interact with it and move things around.+[[https://www.geogebra.org/ |Geogebra]] is a graphing and geometry tool I've been using since my teaching days.  I always found it to be very useful to display concepts that are hard to visualize on a static page.  However, it is a lot more than a simple animation since people can interact with it and move things around.
  
 In the past, I had to export Geogbra files to html5 to embed them, but the process was pretty clunky and time consuming. I searched the Dokuwiki plugins but all the ones listed are too old and don't work anymore.  Finally, I created my own using some general instructions for [[https://wiki.geogebra.org/en/Reference:GeoGebra_Apps_Embedding |embedding Geogebra files]].  This is my first plugin and a bit of a cheat: I basically took the existing [[https://www.dokuwiki.org/plugin:color |Color plugin]] which is pretty simple, studied it to learn a bit of the syntax and modified it until it did what I needed.  However, there's still a lot of code that I don't really understand and a few features that are missing. In the past, I had to export Geogbra files to html5 to embed them, but the process was pretty clunky and time consuming. I searched the Dokuwiki plugins but all the ones listed are too old and don't work anymore.  Finally, I created my own using some general instructions for [[https://wiki.geogebra.org/en/Reference:GeoGebra_Apps_Embedding |embedding Geogebra files]].  This is my first plugin and a bit of a cheat: I basically took the existing [[https://www.dokuwiki.org/plugin:color |Color plugin]] which is pretty simple, studied it to learn a bit of the syntax and modified it until it did what I needed.  However, there's still a lot of code that I don't really understand and a few features that are missing.
Line 8: Line 8:
 Here's how to installed it: Here's how to installed it:
 <hidden> <hidden>
-  * Add the following three files in the wiki folder: ''./lib/plugins/ggb/''+  * Add the following three files in the wiki folder: ''./lib/plugins/ggb2/''
   * ''manager.dat''<code>   * ''manager.dat''<code>
 installed=Sun, 08 Nov 2020 08:20:00 -0800</code> installed=Sun, 08 Nov 2020 08:20:00 -0800</code>
   * ''plugin.info.txt''<code>   * ''plugin.info.txt''<code>
-base   ggb+base   ggb2
 author Patrick Truchon author Patrick Truchon
 email  patoo@rbox.me email  patoo@rbox.me
 date   2020-11-08 date   2020-11-08
 name   geogebra6 syntax plugin name   geogebra6 syntax plugin
-desc   Include GeoGebra6 files into Dokuwiki</code>+desc   Embeds GeoGebra 6 files into Dokuwiki</code>
   * ''syntax.php''<code php>   * ''syntax.php''<code php>
 <?php <?php
 /** /**
- * Plugin ggb: Embeds Geogebra files into Dokuwiki.+ * Plugin ggb2: Embeds Geogebra files into Dokuwiki.
  *  *
  * @license    GPL 3 (http://www.gnu.org/licenses/gpl.html)  * @license    GPL 3 (http://www.gnu.org/licenses/gpl.html)
Line 38: Line 38:
  * need to inherit from this class  * need to inherit from this class
  */  */
-class syntax_plugin_ggb extends DokuWiki_Syntax_Plugin {+class syntax_plugin_ggb2 extends DokuWiki_Syntax_Plugin {
  
     function getType(){ return 'substition'; }     function getType(){ return 'substition'; }
     function getSort(){ return 306; }     function getSort(){ return 306; }
-    function connectTo($mode) { $this->Lexer->addSpecialPattern('{{ggb>.*?}}',$mode,'plugin_ggb'); }+    function connectTo($mode) { $this->Lexer->addSpecialPattern('{{ggb>.*?}}',$mode,'plugin_ggb2'); }
  
  
Line 101: Line 101:
  
 The syntax is:<code> The syntax is:<code>
-{{ggb>path/to/geogebrafile.ggb 740,300}}</code>+{{ggb>/path/to/geogebrafile.ggb 740,300}}</code>
  
 Note that at the moment, if a path is used, it must use ''/'' instead of '':'' The default dimensions are 800x400 if they are omitted. Note that at the moment, if a path is used, it must use ''/'' instead of '':'' The default dimensions are 800x400 if they are omitted.
Line 111: Line 111:
 When two waves overlap, they add up together at every point.  Here, the <fc #4682b4>blue</fc> and <fc #008000>green</fc> waves are generated and add up together to form the <fc #ff0000>red</fc> wave.  You can move the blue and green waves and see the result.  To convince yourself that the red wave is really the sum of the blue and green waves, look at points <fc #4682b4>A</fc>, <fc #008000>B</fc>, and <fc #ff0000>C</fc> You  can move the blue or green waves by sliding their phase (<fc #4682b4>φ</fc> and <fc #008000>Φ</fc>) around.  You'll see that point <fc #ff0000>C</fc> is always the sum of <fc #4682b4>A</fc> and <fc #008000>B</fc>. When two waves overlap, they add up together at every point.  Here, the <fc #4682b4>blue</fc> and <fc #008000>green</fc> waves are generated and add up together to form the <fc #ff0000>red</fc> wave.  You can move the blue and green waves and see the result.  To convince yourself that the red wave is really the sum of the blue and green waves, look at points <fc #4682b4>A</fc>, <fc #008000>B</fc>, and <fc #ff0000>C</fc> You  can move the blue or green waves by sliding their phase (<fc #4682b4>φ</fc> and <fc #008000>Φ</fc>) around.  You'll see that point <fc #ff0000>C</fc> is always the sum of <fc #4682b4>A</fc> and <fc #008000>B</fc>.
  
-{{ggb>howto/hambasics/sections/waveaddition.ggb 800,500}}+{{ggb>/howto/hambasics/sections/waveaddition.ggb 800,500}}
  
  
blog/2020-11-08/geogebra_plugin.1604856223.txt.gz · Last modified: 2020/11/08 09:23 by va7fi