Skip to content

RegularPolygon implementationย #82

Open
@andrewhong04

Description

@andrewhong04

@Emc2356 has already done a PR that does exactly this, but not in what I hoped. #73

To recap, the function is supposed to create a polygon with sides of equal length.

I was thinking of either reimplementing his PR's design to look more like this:

def RegularPolygon(pos, radius) -> Polygon

# So we would use it like this
geometry.RegularPolygon(...)

Or we can do something like this

class RegularPolygon(Polygon):
   def __init__(self, pos, radius): ...

If RegularPolygon becomes a child class of Polygon, the user would be able to modify its radius, origin_pos, etc on the go, where as if we implement the function method, the user would need to create a new Polygon when they want to change its radius as well as using a for loop to change every point to the Polygon

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions