Skip to content
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

stdlib: quaternions #19185

Closed
expikr opened this issue Mar 4, 2024 · 8 comments
Closed

stdlib: quaternions #19185

expikr opened this issue Mar 4, 2024 · 8 comments

Comments

@expikr
Copy link
Contributor

expikr commented Mar 4, 2024

Discuss, whether quaternions should be deliberately out-of-scope for the stdlib and best left to third party geometry libraries, or if a rudimentary datatype could be added for other libraries to build upon?

@nektro
Copy link
Contributor

nektro commented Mar 4, 2024

Duplicate #947

@expikr
Copy link
Contributor Author

expikr commented Mar 4, 2024

That one was a general discussion on math types at the language level, focused on usability features like operator overloading. This one is for the stdlib, specifically for whether or not quat has a place in the stdlib at all.

@slonik-az
Copy link

Quaternions should NOT be in the sdtlib. It is too esoteric and multiple implementations exist for different use-cases. Clearly in the realm of specialized libraries.

@ajahraus
Copy link

ajahraus commented Mar 5, 2024

Are Complex numbers in the stdlib?

@mlugg
Copy link
Member

mlugg commented Mar 5, 2024

std.math.Complex

@slonik-az
Copy link

Complex numbers naturally arise as an algebraic extension of real numbers when you take operations like sqrt(-1). And set of complex numbers are algebraically closed, i.e. all algebraic operations on complex numbers result in complex numbers. Quaternions, on the other hand is a different construction all together. They are non-commutative and are an instance of Clifford algebra. They are very useful in graphics, for quaternions are naturally related to spacial rotations. Graphics, physics simulations, gaming libraries are the natural places to implement Quaternions.

@expikr
Copy link
Contributor Author

expikr commented Mar 5, 2024

Also note that complex numbers are in the C99 spec and, if I understood correctly, there are efforts to move them out from the zig std and into the language itself. (#16278)

@andrewrk
Copy link
Member

Duplicate of #947. This issue is also too vague. @expikr please keep your open non-bug issue count below 5. You are currently at 16, so you're already 11 over budget.

@andrewrk andrewrk closed this as not planned Won't fix, can't repro, duplicate, stale Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants