pygame-ce
pygame-ce copied to clipboard
Added `geometry.Line` base
This pull request adds the Line class to the pygame.geometry module.
It also adds the xa, ya, xb, yb, a, b attributes, str functionality (for printing), and the copy method. It also adds their associated docs and tests.
Important Note
As things stand, we don't accept building a Line with the exact same start and end point. This isn't strictly necessary as we
reversed this same behaviour with the Circle class. Just tell me if this should be changed in this PR on a following one.
Credits
Geometry Project: For code, docs and tests: @novialriptide @Emc2356 @itzpr3d4t0r @ScriptLineStudios @avaxar @Matiiss @newpaxonian @maqa41 @blankRiot96 Also thanks to @Starbuck5 for kickstarting the idea and the occasional help!
Functionality added in this PR
-
geometry.pyihttps://github.com/pygame-community/pygame-geometry/blame/main/geometry.pyi Credits to @Emc2356 @itzpr3d4t0r @novialriptide @ScriptLineStudios @avaxar -
geometry.rsthttps://github.com/pygame-community/pygame-geometry/blame/main/docs/line.rst Credits to @Emc2356 @itzpr3d4t0r @ScriptLineStudios @avaxar -
line.chttps://github.com/pygame-community/pygame-geometry/blame/main/src_c/line.c Credits to @Emc2356 @itzpr3d4t0r @novialriptide @ScriptLineStudios @avaxar -
geometry.hhttps://github.com/pygame-community/pygame-geometry/blame/main/src_c/include/geometry.h Credits to @Emc2356 @itzpr3d4t0r @maqa41 -
geometry.chttps://github.com/pygame-community/pygame-geometry/blame/main/src_c/geometry.c Credits to @Emc2356 @itzpr3d4t0r @novialriptide @ScriptLineStudios @avaxar -
geometry_test.pyhttps://github.com/pygame-community/pygame-geometry/blame/main/test/test_line.py Credits to @Emc2356 @itzpr3d4t0r @novialriptide @ScriptLineStudios @avaxar
woah
Is there any specific reason why the coordinates are named with xa, yb instead of ax, by?
The current is annoying for me to parse mentally, as it looks backwards and the 'subscript' appears in front of the point.