Consider a graph of an equation like y = sin(x).
Now suppose that I want to have a single equation where y gets the same value that it would get in the following computer code:
if (y - sin(x) <= 45) {
y = sin(x);
}
else {
y = 0;
}
How would I mathematically build the above logic into a single math equation with no externally defined functions, for graphing (or really any other purpose)?
Note: this is a question about standard math notation, not a particular calculator.
I don't know how calculators behave, but we can use indicator functions for this: $$y := x 1[y-x \leq 45] + y 1[y-x > 45]$$ where $1[\phi]$ is defined to be zero if $\phi$ is false, and $1$ if $\phi$ is true.