Thinking Domain Math
Thinking domain math is a simple freeform spreadsheet style.
Cells are in the form: HOW_TO_FORMAT VARIABLE_NAME (VALUE) OPERATOR
HOW_TO_FORMAT
The default variable name is
Display-only cells (those without expressions or values) are expanded on a second pass so they always show final results for that variable. This allows display cells like \$tool() to be anywhere, even at the top, and still show totals. If you want to show the current value of a variable, basically the subtotal, at that place in the page, you can put the word now in the cell like this \$tool(now).
\$a(22.50) → $a(22.50)
\$b(abs(-22)) → $b(abs(-22))
\?c(pow(2,3)) → ?c(pow(2,3))
\?d(2 ^ 3 + 5 / 13) → ?d(2 ^ 3 + 5 / 13)
\?e(pow(2,3) + (5 * 2)) → ?e(pow(2,3) + (5 * 2))
\$f(
\$f(20)- → $f(20)-
\$f() → $f()
\?(pi) → ?(pi)
The
The
Example: \$(a+b)~ will show the last value used to change variable
The
Example: \$(a-b+c)() would show the result of the expression
For example, here is a nice little spreadsheet utilizing math cells with these operators.
and the output is
And hey, if you just want to calculate something simple, like the ounces in coke can, you can simply put it in the page as mathjs. The formula is PI * radius^2 * height / oz conversion
ounces in a coke can = \?(
radius = 1.25;
height = 4.415;
conversion = 1.805;
pi * radius ^ 2 * height / conversion;
)
ounces in a coke can = ?(
radius = 1.25;
height = 4.415;
conversion = 1.805;
pi * radius ^ 2 * height / conversion;
)
Cells are in the form: HOW_TO_FORMAT VARIABLE_NAME (VALUE) OPERATOR
HOW_TO_FORMAT
$
dollars with optional cents%
percent format?
generic decimal format
- any combination of lower case letters or an underscore
- A numeric value or a mathjs expression
- How to apply this number to the variable RPN style. One of
+ – * / =
- Portable drill \$tool(89.95)+
- Hammer \$tool(15.20)+
- Saw \$tool(22.50)+
- Chisel \$tool(3)+
- Total \$tool()
- Portable drill $tool(89.95)+
- Hammer $tool(15.20)+
- Saw $tool(22.50)+
- Chisel $tool(3)+
- Total $tool()
=
which assigns the output of the cell to the respective variable.The default variable name is
tot
so if you are only adding up one set of things per thought you can leave off the variable name and simply put \$(89.95) and \$(15.20) etc. and the total can simply be either \$() or \$tot() as you like. You can also use the default variable as a junk or scratchpad variable to display expressions when you don’t need the result placed in a named variable, for example \?(a * b + c) which will display the expression result and incidentally add the result to tot
which can be ignored.Display-only cells (those without expressions or values) are expanded on a second pass so they always show final results for that variable. This allows display cells like \$tool() to be anywhere, even at the top, and still show totals. If you want to show the current value of a variable, basically the subtotal, at that place in the page, you can put the word now in the cell like this \$tool(now).
Math cells can go anywhere. Inside table cells, in free text, wherever you want.
Some examples of JavaScript math expressions that can be in cells
\$a(22.50) → $a(22.50)
\$b(abs(-22)) → $b(abs(-22))
\?c(pow(2,3)) → ?c(pow(2,3))
\?d(2 ^ 3 + 5 / 13) → ?d(2 ^ 3 + 5 / 13)
\?e(pow(2,3) + (5 * 2)) → ?e(pow(2,3) + (5 * 2))
\$f(
a
+ 0.50) → $f(a + 0.50) ← yes, variables are expanded\$f(20)- → $f(20)-
\$f() → $f()
\?(pi) → ?(pi)
Additional operators for sums and totals
The ~
and ()
operators allow changing the context for variable expansion. This is mainly useful for summing rows and displaying complex totals. These operators are mainly for generating display, though the ~
operator does assign the displayed (subtotal) value into the respective variable which is nice for gaining access to those values.The
~
operator works like the =
operator in that it fills the designated variable except that it causes variables being expanded to take on the value that was last operated on (i.e. visble) for that variable instead of the current value of the variable in the sheet. You can think of this like a row sum … though it is not limited to a physical row or to only summing, as the expression can be any valid mathjs expression.Example: \$(a+b)~ will show the last value used to change variable
a
added to the last value used to change variable b
… which if in the same row, would be the sum of the values those cells are showing in the current row.The
()
operator defers this cell to the second pass, hence all variables in any expression have their final value no matter where they are in the flow of the page.Example: \$(a-b+c)() would show the result of the expression
a – b + c
after all other operations on a and b and c are complete, no matter where in the page this cell is physically located.For example, here is a nice little spreadsheet utilizing math cells with these operators.
item | cost | paid | remaining |
---|---|---|---|
Skirting | \$k(250)+ | \$p(250)+ | \$(k-p)~ |
6 Blocks | \$k(1.50*6)+ | \$p(0)+ | \$(k-p)~ |
Jack | \$k(30)+ | \$p(0)+ | \$(k-p)~ |
Total | \$k() | \$p() | \$(k-p)() |
and the output is
item | cost | paid | remaining |
---|---|---|---|
Skirting | $k(250)+ | $p(250)+ | $(k-p)~ |
6 Blocks | $k(1.50*6)+ | $p(0)+ | $(k-p)~ |
Jack | $k(30)+ | $p(0)+ | $(k-p)~ |
Total | $k() | $p() | $(k-p)() |
And hey, if you just want to calculate something simple, like the ounces in coke can, you can simply put it in the page as mathjs. The formula is PI * radius^2 * height / oz conversion
ounces in a coke can = \?(
radius = 1.25;
height = 4.415;
conversion = 1.805;
pi * radius ^ 2 * height / conversion;
)
ounces in a coke can = ?(
radius = 1.25;
height = 4.415;
conversion = 1.805;
pi * radius ^ 2 * height / conversion;
)
Tags
- math
- spread sheets
- kudos
Comments
Seth says
👍
👍
Seth says
seems very useful … i need this stuff for various projects … #kudos → nathan
They scope to just one thought … right?
seems very useful … i need this stuff for various projects … #kudos → nathan
They scope to just one thought … right?
Si says
They scope to one item. i.e. a thought body, or a comment. Very similar to a spreadsheet. Played around with various scoping, but the item scope came out as the overall most useful. Could create a special syntax for a global and/or whole thought scope if that is someday needed, but currently I don’t need it and can only think of a very few times I would. Could also just throw in a plugin if you need such expanded ability.
They scope to one item. i.e. a thought body, or a comment. Very similar to a spreadsheet. Played around with various scoping, but the item scope came out as the overall most useful. Could create a special syntax for a global and/or whole thought scope if that is someday needed, but currently I don’t need it and can only think of a very few times I would. Could also just throw in a plugin if you need such expanded ability.
Si says
What I am using this for right now is spreadsheeting several rental properties and the needed repairs to bring them up to code verses the long term income.
What I am using this for right now is spreadsheeting several rental properties and the needed repairs to bring them up to code verses the long term income.
Seth says
👍
👍
See Also
- Thought Well here i am back in this reality with 312 viewings related by tag "kudos".
- Thought To upload mp3 files to Fillmore box 6300 with 129 viewings related by tag "kudos".
- Thought Go Mark! with 102 viewings related by tag "kudos".
- Thought 2016C - FALL CD catalog production with 86 viewings related by tag "kudos".
- Thought Making up Others with 85 viewings related by tag "kudos".
- Thought Amazon's Buy Box Games with 52 viewings related by tag "kudos".
- Thought Fo Hammer popped up at the FBI today. with 43 viewings related by tag "kudos".
- Thought Other Math Curiosities with 30 viewings related by tag "math".
- Thought Footer problem on individual page at speaktomecatalog.com with 19 viewings related by tag "kudos".
- Thought Meatloaf with 17 viewings related by tag "kudos".
- Thought Lovely tag cloud! with 16 viewings related by tag "kudos".
- Thought Bookmarks Love with 15 viewings related by tag "kudos".
- Thought about: rolling hypocycloids with 14 viewings related by tag "math".
- Thought about: how it works - ideabuzz with 13 viewings related by tag "kudos".
- Thought Probably the most pertinant speech yet this century with 11 viewings related by tag "kudos".
- Thought OMG We are back in business ... with 11 viewings related by tag "kudos".
- Thought spreadsheets with 7 viewings related by tag "spreadsheets".
- Thought Conversations are Kewl with 6 viewings related by tag "kudos".
- Thought Cell server test with 3 viewings related by tag "math".
- Thought open source javascript spreadsheet engine with 3 viewings related by tag "spreadsheets".
- Thought Conversation Rooms with 1 viewings related by tag "kudos".
- Thought Monday Morning Math with 1 viewings related by tag "math".
- Thought Some math musing re philosophy of mind with 1 viewings related by tag "math".
- Thought about: TrimSpreadsheet - TrimPath - Trac with 1 viewings related by tag "spreadsheets".
- Thought you now can embed Num Sum spreadsheets in items with 1 viewings related by tag "spreadsheets".
- Thought Google spreadsheet soon with 0 viewings related by tag "spreadsheets".
- Thought WikiCalc with 0 viewings related by tag "spreadsheets".
- Thought about: rima regas - google+ - maths simple visual how trigonometry works with 0 viewings related by tag "math".
- Thought [title (18359)] with 0 viewings related by tag "math".
- Thought web spreadsheets with 0 viewings related by tag "spreadsheets".
- Thought Group Listing with 0 viewings related by tag "spreadsheets".