Nigecat / obsidian-desmos

Embed graphs directly into your obsidian notes
GNU General Public License v3.0
123 stars 7 forks source link

Absolute value functions conflicting with piecewise #113

Closed Cyprinus478 closed 5 months ago

Cyprinus478 commented 5 months ago

I am trying to graph |x|, -|x|, and sin(x) to display squeeze theory at the limit of 0, however, the plug-in won't allow the graphing of absolute values of x.

trying to graph with the code

y=\sin(x)
y=|x|
y=-|x|

shows the error: Desmos Graph Error: A piecewise expression must have at least one condition.

interesting note: entering

y=\sin(x)
y=|x|

does not display an error however the absolute value function is not displayed

Nigecat commented 5 months ago

You need to use the abs function directly, for example:

y=\abs(x)