Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Vectorize coordinates in draw commands? #35

Open
TelosTelos opened this issue Jan 19, 2021 · 4 comments
Open

Vectorize coordinates in draw commands? #35

TelosTelos opened this issue Jan 19, 2021 · 4 comments

Comments

@TelosTelos
Copy link
Collaborator

Draw commands often refer to paired x,y values. I've now mostly finished vectorized operations, including the ability to "unpack" vectors into commands like dst(), atan2() and Unit.move_to() that require x and y as separate operands in a single mlog instruction. Should I use this same machinery for draw commands? This would provide consistency, and also make some mathematical operations involving drawing a bit easier to perform: e.g., the midpoint between points A and B is (A+B)/2. It would however make raw draw commands a tiny bit more cluttered, e.g. draw.line( [0,0], [10,10] ) rather than draw.line( 0,0,10,10 ), though arguably these cluttering brackets actually make it more readable.

@Leo-MathGuy
Copy link
Contributor

What about a separate function like draw.vecLine(pointA, pointB) instead of replacing the current function?

Moreover:
A vector is a origin, direction, and magnitude. So actual vector functions that would also be cool are draw.degLine(pointA, degrees, magnitude), degrees being degrees CCW from due east (trig functions work this way) and draw.radLine(pointA, radians, magnitude) for radians.

@Leo-MathGuy
Copy link
Contributor

Wait its Screen.line

@Leo-MathGuy
Copy link
Contributor

not draw.line

@Leo-MathGuy
Copy link
Contributor

unfortunately until lists get added this will not work :(

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants