Basic Trigonometry

Theme:

Save this workbook to your existing GitHub account :

Return to parent.

The concept of a Xholon Workbook is a work in progress. The descriptive text on this page is mostly about the Java-based jvmEdition, while many of the workbooks are intended to run in the web-based webEdition. All of the code (JavaScript, Python, XML), and notes on this page can be edited in place. The code may include a simple working example about the height of a block. Any line with the word "block" or "height" (uppercase or lowercase) can be commented out, removed, or edited to become part of your own app.


Python code

Try at ideone.com (Use Python rather than Python 3).

Try at Xholon Chameleon. Select File > Open. Locate the Model > CompositeStructureHierarchy > Chameleon node (chameleon_0) in the tree. Select the entire above script, including the opening and closing <script> tags, and drag it on top of the Chameleon node. Or use copy and paste(Right-click the Chameleon node and select Edit > Paste Last Child). The result should appear in the Java Console.


JavaScript code

Try at Xholon Bootstrap (Use alert instead of print).

Try at ideone.com (Use JavaScript (Rhino)).

Try at Codecademy (Use console.log instead of print).

Try at the Xholon Bestiary. Click on Start app. Then insert the entire above script, including the opening and closing <script> tags, into the Bestiary console. Press the Submit button, and watch for the result in the Java console. Use Pause and Unpause to control the pace. Sorry about all the cats and people running around and sounding off, but the Bestiary is their home.

The JavaScript code will also run with Chameleon, as described for the Python code.


Xholon (webEdition)

Run this workbook in a browser window as a HTML/JavaScript app.


Xholon (jvmEdition)

Step 1: Launch the Xholon Chameleon app. Chameleon can be used with JavaScript, Python, Java/Beanshell, Ruby, or Groovy. The first launcher below supports both JavaScript and Python (Jython), but takes longer to download, and Python intermitently reports a VerifyError. The second launcher supports JavaScript and Java/Beanshell. The third launcher supports JavaScript and Ruby (JRuby). The fourth supports JavaScript and Java/Groovy. The Java Console must be enabled to see the results of print statements.

Step 2: Insert (copy and paste, or drag and drop) the following XML class inheritance hierarchy as the last child of XholonClass. Press Ctrl-Space to select from a partial list of other quantities.

Step 3: Insert the following XML class details as the last child of XholonClass. Press Ctrl-Space to select from a list of possible ports.

Step 4: Insert the following XML composite structure hierarchy as the last child of Chameleon. Press Ctrl-Space to select from a list of valid quantities.

Step 5: Press the Refresh button on the Xholon Chameleon app. Locate a node that is probably a child of the Chameleon > TrigSystem node, and insert one of the following behavior scripts as the last child of that node. For example, a behavior script called Blockbehavior would typically be inserted as the last child of Block.


SVG image

Edit and display with the svg-edit visual editor. Select Edit Source, and paste in the above lines starting and ending with the <svg> tags.

Display by pasting into your browser address bar, the above lines starting with data:image/svg+xml, and ending with the closing </svg tag.

Insert all of the above lines, including the opening and closing <SvgClient> tags, as the last child of Chameleon.


This page uses Xholon Workbook, Xholon webEdition, CodeMirror, and jQuery.