Function m(x) finds the arbitrary minimum x value between two points, using midpoint minus half range as a strategy. Function n(x) does the same for minimum y value.
24
25
26
Functions g(x) and h(x) are super "hacky." I basically needed a set of tools to help me keep the domain/range boundaries flexible. This tool needs to start the segment at the minimum or end the segment at the maximum depending on how the points relate to one another.
27
This means keeping track of slope -- s(x) and making it possible for a the graphing tool to read a maximum graphed value in one situation as a minimum in another.
28
Both functions are written in a way that, when the output of s(x) changes to negative, the half the function that determines behavior in cases of positive slope suddenly cancels out.
29
30
31
The hacking continues below. I had to come up with a way for the step building process to reverse if the slope suddenly changed. Usually, when you try this sort of thing in Desmos, you find yourself taking advantage of symmetric patterns in the function construction. The hardest part was breaking through that assumption, I think.
32
33
34
Needed these functions below to act as an on-off switch. p(x) zeroes out when the slope is positive but returns identity when the slope is positive. q(x) does the opposite. In retrospect, I could clean up the code above by using these tools.
35
36
37
ROUTE COMPLETION TOOLS (Slope Sensitive)
38
39
40
41
42
43
44
45
46
47
48
powered by
powered by
New Blank Graph
Examples