joshuabowers / graphca

A graphing calculator and analytic calculus engine
MIT License
0 stars 0 forks source link

Graphing 2d Inequalities #16

Open joshuabowers opened 1 year ago

joshuabowers commented 1 year ago

Assuming that #14 and #15 can be properly resolved, inequalities (such as y < x^2) should be capable of being plotted by GraphCa.

If the rendered curves are as in #14, each continuous segment is comprised of linear slices. Each of these slices can form the edge of a triangle-/quad-fan that extends to the y-axis edge of the graph that corresponds to the implied direction of the inequality operator. (E.g. for less-than inequalities, the lower-bound of the y-axis within the viewport would be used; conversely , for a greater-than inequality, the upper-bound would be used.) The shapes defined by these slices, amusingly, are evocative of integrals.

Each of these shapes could be colored with the curve color (though with an alpha-channel for overlapping regions to be discernible). How would the curve itself for a non-equals inequality be rendered? (For consideration, consider the semantic difference between y < x^2 and y <= x^2; the latter includes a set of values for y that the former does not.) A dashed-line would be obvious, but might require slight alterations to colors and a secondary render of each curve.

Question: does three.js or drei support a dashed line rendering mode for line segments?