It's been interesting tackling it exactly like characters in a MMO.
(This is a calculator thread, by the way.)
This all changed when I was introduced to RPN calculators: hpmuseum.org/rpn.htm
A mysterious little bugger full of secrets and hidden tricks.
Here was a world full of hidden, arcane secrets & treasures, a world governed by mysterious, but ultimately knowable rules packaged in an instruction manual.
I 💜 it!
I don't know if I have a favorite calculator, but I do keep coming back to this very one an awful lot.
Let start with the imaginary numbers—a name loathed by every math teacher I've ever had, but come on, what could be more alluring than a fucking imaginary number?
Any time you multiply any two positive numbers, the result is positive.
Any time you multiply any two negative numbers, the result is also positive.
This fucks things up when you're trying to find a number times itself that equals a negative number.
So you make up an imaginary number: i.
i×i=-1
And you push forward.
You just have to sort of keep track of it, the same why you might have to track a variable in an equation.
n×2=2n, right?
2n+3=well, 2n+3
4×(2n+3)=8n+12
You keep throwing arithmetic at this and you'll lose track of your 2 and 3, but that's okay, because you know their in there.
No matter what, you know where your n is, because it can't really mix in.
i×2=2i
2i+3=2i+3, which is perhaps more traditionally written 3+2i
4×(3+2i)=12+8i
Except! If now multiply it by i something magical happens.
Because 12×i is just 12i, but 8i×i is 8i², and i's whole deal is that when it's squared it's -1.
So 8i² is 8×-1, or -8.
If we'd done this trick with n, we'd just have 12n+8n², which is interesting, but no sorcery.
The reason why I keep rewriting it so that the real part comes before the imaginary is also the reason why complex numbers might be of use to a d20 game.
2 becomes 2i becomes -2. You can keep going!
A dungeon grid. A battle map.
Measure every combatant's location in relation to this Origin of the Storm.
If you're 20 feet north and 15 west, you're -15+i20.
Most of grade school math is a game of Find the Number, but that game is really Hide the Truth Behind a Number!
But, like, 4+3=4+3, and that's just as true.
And much more profoundly, 4+3=3+4, which so much more interesting.
It's what you do when you want to tweet about the 3 blue jays & 4 crows you saw fighting over something in a dead tree today, but your description of the tree ran long & you only have enough characters left to say there were 7 corvids.
There's a loss of data, but usually when you wrap an expression up like that, it's because you no longer need that data. 7 corvids unless it matters how many were crows.
(4+i0)+(3+i0)=4+3+i0+i0=7+i0
Which, not coincidentally, is also 7.
4, 3, & 7 are living in a 1 dimensional world on that real number line. 4+i0, 3+i0, & 7+i0 are living in 2 dimensions!
I mean the answer is clearly yes, but we're going to use a calculator here, so we need an algorithm.
So if G=5+20 and F=140, you can calculate 20+5-140=-115…
-115²=13,225
√13,225=115
en.wikipedia.org/wiki/Plimpton_…
In a triangle with an angle that measures 90°, c is the side opposite of that angle and a & b are the other two sides: a²+b²=c²
a=Gx-Fx
b=Gy-Fy
It doesn't matter if we subtract the gnome's position from the foe's or vice versa. It doesn't even matter if you switch the order from a to b.
a²+b²=c²
(Gx-Fx)²+(Gy-Fy)²=c²
So the √(c²) is c, or the distance between the combatants!
On the Free42, you can enter complex numbers in pretty easily by keying in the real part first, hitting [Enter], keying in the imaginary part, and then hitting [Complex].
Want to know how far your Gnome is from your Foe?
[RCL] Gnome
[RCL] [-] Foe
[Shift] [Convert] [ABS]
00 { 11-Byte Prgm }
01▸LBL "Dstnc"
02 -
03 ABS
04 .END.
To use it, just put both positions in the stack and [XEQ] [Dstnc].
Have we lost some data here? Is there something else we're concerned with when asking "How far to run from giants & their boulders?"
But since this nexus of crisis is made of zeros, we don't even have to go that far.
Next up, in which direction...