4. Including applets#

4.1. SVG#

Figure 4.1 shows how you can geometrically add two arrows in a plane. The image is a SVG image rendered in the browser.

../_images/Fig-Vectors-AdditionPlane.svg

Fig. 4.1 Geometrical interpretation of addition in the plane.#

4.2. Applet#

It is of course much nicer if you can interact with the image. One way of adding interactivity in the browser is through applets.

../_images/Fig-Vectors-3Daddition.svg

Fig. 4.2 Geometrical interpretation of addition for three-dimensional vectors.#

4.3. Credits#

Vector applet developed by Beryl van Gelderen, integration of applet in Jupyter book by Julia van der Kris and Abel de Bruijn, all as part of the open linear algebra book under development by PRIME.

4.4. Applets in iframes#

The applet can also be included via an iframe:

4.5. HTML files as applets#

As we can now integrate other HTML files (with their own style sheets and JavaScript), the possibilities are endless. I can for example include this simple website on which you can practice your arithmetic.

../_images/Fig-Vectors-3Daddition.svg

Fig. 4.3 Arithmetic practice.#

4.6. HTML files as iframes#

Alternatively, you can include an external HTML file with an iframe:

The upshot of using an iframe is that you can set the following parameters:

  • Width in pixels (default is 300)

  • Height in pixels (default is 150)

  • Loading: either lazy (when needed) or eager (immediately).

  • allowfullscreen

  • scrolling: whether to show scrollbars (true, false, or auto).