What should I add to my quadrilateral generator

Whenever I don’t know what to work on I make shape generators that measure what it can to help me learn a bit more math. I’ve made it with a triangle and now I’m working on one for quadrilaterals.

So far I’ve added:

area centroid, centroid, inradius (haven’t been able to do the incenter), Circumcenter of mass, a tangential checker, and Newton and Eulers lines.

You already know more about quadrilaterals than I do, so I don’t have any math suggestions, except maybe draw the circles whose centers you display.

But I think you don’t know that Snap!'s numeric functions accept lists as inputs and apply whatever function it is to the items of the list termwise, so you can say




instead of taking the trouble to represent the points as lists and then undoing that to pull out the X and Y coordinates.

P.S. Your, ah, unique preferred variable names makes your code hard to read! :~)

sorry for not responding for a bit, and for the variable names, i always forget about readability when working on random things. ill work on redoing the points as a list and redoing variable names.

and thanks for the circle suggestion, i think i’ve done what you were talking about. I’ve also added the ability to set points instead of it being purely random, you can now drag the points as well (though it does flash a lot with redrawing it, so be careful with that), and i plan on adding another list that shows the measurement’s of the circles. Though the block does look cluttered now T-T.

Though the block does look cluttered now T-T.

Use helper procedures! Even if you call a procedure only once, it can still help to separate out pieces of a long script.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.