Discourse Math Plugin [Enabled]

Continuing the discussion from chatGPT creates Arduboy Game:

@bateske,
Any thoughts on adding this to the forum?

3 Likes

I actually never realized until now that ^2 is a square. I just use “square.”

In some programming languages ^ is the exponentiation operator rather than exclusive or. Most notably, most BASIC variants, Lua, and Haskell (though Haskell’s operators aren’t built in to the language)

1 Like

@bateske, :cricket: :cricket: :man_shrugging:?

My thought is: why do we need this?

Because:

  • $x^2$ is easier to type than x<sup>2</sup> (x2).
  • $\sum_{i=0}^n$ is easier than trying to do Σ<sup>n</sup><sub>i=0</sub>ni=0).
  • $\frac{1}{2} is easier than trying to represent 1/2 as a fraction without resorting to weird hacks like <sup>1</sup>&frasl;<sub>2</sub> (12).
  • Hunting for Unicode characters can be annoying.
    • $\Omega$ is easier to write than to hunt down an Ω chracter (for those of you who like Ohms).
  • Lots of other neat stuff.

Haha, on MacOS if you press Opt + Z you get the omega symbol.

ΩΩΩΩΩΩΩ

On Windows there’s probably an Alt-code for it, but I keep losing my Alt-code ‘cheatsheet’
I only ever remember Alt+26 (→) because I use it more frequently than others.

I think you two will be the only people to use it but you are cool so good job. Math plugin enabled.

6 Likes

\frac{\tau h \alpha n \kappa s}{\beta \alpha \tau \varepsilon s \kappa \epsilon}

4 Likes

Not true. What prompted me to research and request the plugin be enabled was that the equations in a post by @dima-78 weren’t being properly displayed. With the plugin enabled, they now are:

We aren’t even talking about the arduboy really there and if it gets used primarily for non math purposes i’ll turn it off.

Yes,
\star \mathfrak Thanks \Rightarrow \mathfrak Bateske \star

1 Like

Seriously though, it could be useful for writing some equations used for games such as for complex movement. Plus, there aren’t any downsides I can see to having it enabled. It doesn’t impact any other aspects of the forum.

1 Like

No, but trigonometry does get used in games, so the subject being discussed is still relevant.

I expect it’ll find use when discussing the electrical side of things too. E.g. Now people can actually talk about 10 \Omega ($10 \Omega$) resistors witout having to deal with Unicode, or discuss things like V = IR with proper rendering.

In particular, I think it will be useful for helping people decipher mathematical explanations and understand their code equivalents.

E.g. for vectors:

  • \vec a \cdot \vec bdot(a, b)
  • |\vec v|v.length()/length(v)
  • \sqrt{v_x^2+v_y^2}sqrt(v.x * v.x, v.y * v.y)

Or for 3D/2D affine transformations and matrices:

\begin{bmatrix} x \\ y \end{bmatrix} \begin{bmatrix} cosine(angle) & sine(angle) & 0 \\ -sine(angle) & cosine(angle) & 0 \\ 0 & 0 & 1 \\ \end{bmatrix}

x' = cosine(angle) * x - sine(angle) * y + 0
y' = sine(angle) * x + cosine(angle) * y + 0

1 Like

Or things like V_{CC} or R_{DS(on)}

1 Like

You’re missing an e before the s :flushed: (although I’m not sure if that was intentional)

Finally, you’re speaking my language!

Fixed it. I probably forgot it when I stopped to look up what the Greek equivalent of ‘k’ is called.
(My Greek is getting rusty through disuse.)