Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discontinuous functions #19

Open
leonhma opened this issue Aug 5, 2022 · 4 comments
Open

Discontinuous functions #19

leonhma opened this issue Aug 5, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@leonhma
Copy link
Owner

leonhma commented Aug 5, 2022

What's your feature?

Add the possibility to specify discontinuous/piecewise functions and plot them as requested by @yxsjune.

Any related problems?

Currently no way to specify discontinuous functions.

Additional context?

No response

@leonhma leonhma added the enhancement New feature or request label Aug 5, 2022
@leonhma
Copy link
Owner Author

leonhma commented Aug 6, 2022

@yxsjune According to this in builtin-math-eval, you can specify expressions with a ternary operator, so you can do this to specify a piecewise function: x<0 ? x^2 : x+2

The function:

$$ \begin{array}{ll} x^2 & x\lt 0 \\ x+2 & x\geq 0 \end{array} $$

Its not that intuitive but also the only way I see too specify these piecewise functions on a single line of text.

The dots at the jump in the graph are not there yet. > #20

@leonhma leonhma closed this as completed Aug 8, 2022
@leonhma leonhma reopened this Aug 8, 2022
@leonhma
Copy link
Owner Author

leonhma commented Aug 8, 2022

Still needs the (automatic) addition of those circles to discontinuities/singularities.

This probably also needs a PR to functionplot or a plugin for it.

@ghost
Copy link

ghost commented Oct 27, 2022

This does not work for me, Is there a certain format you are supposed to write it in? I copied exactly as it was but it does not work.

@leonhma
Copy link
Owner Author

leonhma commented Oct 27, 2022

@amaribayne

x<0 ? x^2 : x+2

This is the function body. You have to put f(x) = ... for the graph to show up. The discontinuities don't work yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant