Is there a way to graph a set of polygons? I am trying to use aggregate to get a set of triangles.
The simplified version is if I have 6 lists for the x-coordinate and y-coordinate of the 3 vertices. How can I graph the entire set? The best I have been able to manage is see all of them using a slider where “n” indexes the list of triangles.
There is a hacky way to plot a set of polygons. The main idea is to merge everything into a single list, manually “close” each polygon by repeating the first point, and “restart” the polygon drawing by inserting an undefined value between each.
In your graph, I joined (A,B,C,(0/0,0/0)) and manually re-indexed so that it would connect [a1,b1,c1,undefined; a2,b2,c2,undefined; …]: desmos.com/calculator/s0feftgikl
The calculator still thinks you are trying to draw a single polygon, though, so the fills can sometimes intersect with one another and “undraw” portions. If you define your coordinates manually, you can choose a consistent orientation to connect the dots and should be able to avoid this.
Below is an alternative approach that seems to work ok. I am joining this thread a bit late, due to running across it from googling. I’m not sure if the approach here would have worked when the thread was first started, or whether Desmos added these capabilities later.
Nice, thanks! My apologies that I didn’t see your reply sooner. It’s a beautiful technique, and very powerful use of list comprehension. Thanks!
Here’s something I made recently. It doesn’t use your nice trick of making a list of polygons, but it draws a polygon from a variable-length list of coord-pairs, so that the same command can draw a regular n-agon for different values of n, eventually approximating a circle: