-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
points_on_circle function #14
Comments
I could do:
Looks like it is extensible.
This approach an be extended to a line or polygon as well. But I have not introduced methods yet. Not sure, if it is a good idea to do it this way. |
It will be very useful. You should look at these two function in SVG which do the basic stuff. It should work on any path & shape - so I would suggest to name it as a general function that work on Path and Shapes. e.g. For inspiration & examples, also look at Coordinator Library - https://github.com/spotify/coordinator which extends it beyond paths to shape. Write up about the library @ https://engineering.atspotify.com/2018/03/02/introducing-coordinator-a-new-open-source-project-made-at-spotify-to-inject-some-whimsy-into-data-visualizations/ |
Rather than having to get individual points by specifying length, I think it would be better have a function that returns a list of n points at equal distance on the shape/path. Also, instead of having a function specific to path or shape, I suggested a method One option could be to have a global function |
Thats looks quite interested! |
Path and Shapes are different - similar to Stroke and Fill (for Colors). So Points on a Path and Points in a Shape have different meaning. Right now the library does differentiate between the two - so may be later. Also, worth thinking about what happens when you draw multiple shapes? Or is this going to be limited to primitive shapes (line, rectangle, circle) only. |
Agreed. But I'm trying to see if it is possible to unify that.
Thanks for the caution. I'll read up a bit and see if I need to model it differently.
It is only for primitive shapes right now. I can't think of a way to generalize this. However, I would love to find a way to identify a bounding box for any shape. It could be just the center of the shape and width and height. |
It would be interesting to have a function that returns points equidistant on a circle.
These points can be used to create very intersting shapes by connecting to each other point etc. This will allow the students to achive all these shapes without worrying about sine and cosine.
I'm not particularly happy with the name
points_on_circle
. Another option iscrange
, just likerange
, but returns points on a circle.It feels quite useful, but at the same time it also feels like this function doesn't really belong to the joy library and doesn't go well with all other functions.
@amitkaps what do you think?
The text was updated successfully, but these errors were encountered: