From bbce87e26a262a2f442b86608bae06bfd42f3b0e Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Fri, 16 Oct 2020 13:01:19 -0400 Subject: First expression diagram --- docs/style.css | 8 ++++++-- docs/tutorial/expression.html | 45 ++++++++++++++++++++++++++++++++++++++----- 2 files changed, 46 insertions(+), 7 deletions(-) (limited to 'docs') diff --git a/docs/style.css b/docs/style.css index 4e208c47..2dc22dde 100644 --- a/docs/style.css +++ b/docs/style.css @@ -50,10 +50,13 @@ pre, code, textarea, .kb { border: 1px solid #bdcac4; letter-spacing: 0.2; } -.code { +.code, .codeCover { fill: #e3e7e7; stroke: #bdcac4; } +.codeCover { + stroke: #e3e7e7; +} code { padding: 0.15em 0.1em 0.05em; white-space: nowrap; @@ -123,7 +126,8 @@ a:visited { color: #3d155f; } input { border-color: #0c0d0e; } textarea, pre, code { color: #969698; background-color: #0c0d0e; } textarea, pre, code, .kb { border-color: #040509; } - .code { fill: #0c0d0e; stroke: #040509; } + .code, .codeCover { fill: #0c0d0e; stroke: #040509; } + .codeCover { stroke: #0c0d0e; } code { border-color: #0c0d0e; background-color: #0f1011; } table td, th{ border-color: #636967; } table th { border-color: #88918c; background-color: #292a2b; } diff --git a/docs/tutorial/expression.html b/docs/tutorial/expression.html index 5dfa2251..1f14e90b 100644 --- a/docs/tutorial/expression.html +++ b/docs/tutorial/expression.html @@ -60,11 +60,46 @@ 33.5103216382911

The evaluation order is shown below, with the function on the first line evaluated first, then × on the next, and so on. The effect of the parentheses is that ÷ is evaluated before the leftmost ×.

-
 =              23
-            π ×
-     4÷3
-    (   ) ×
-
+ + + + (4÷3) × π × 23 + + + + + + + + + + + + 4 + ÷ + 3 + × + π + × + 2 + + 3 + + + 4 + ÷ + 3 + × + π + × + 2 + + 3 + + + + +

The following rule might help you to internalize this system in addition to identifying when parentheses are needed: an expression never needs to end with a parenthesis, or contain two closing parentheses in a row. If it does, at least one set of parentheses can be removed.

One or two arguments?

What about functions without a left argument? Let's find an equation with lots of square roots in it… looks good.

-- cgit v1.2.3