Skip to content

points_on_circle function #14

@anandology

Description

@anandology

It would be interesting to have a function that returns points equidistant on a circle.

points = points_on_circle(n=5, r=100)
shape = polygon(points)

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 is crange, just like range, but returns points on a circle.

pentagon = polygon(crange(n=5))  # r would default to 100

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?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions