Skip to content

<Complex> and Quaternions/Vectors #947

@BraedonWooding

Description

@BraedonWooding

I think currently one of the big places Zig could be really useful is in data science, for this to occur Zig needs damn good math functionality including stuff like Quaternions and Vectors along with some good complex number support (quaternions are 4 tuple complex numbers if you don't know, furthermore quaternions do need good euler angle support for game dev).

I currently have a brief hackish solution for vectors, which currently only supports a single 3D vector though of course that means it supports 2D vectors (and has a few optimisations in place for those cases such as for getting the angle or doing a cross product). Currently I implemented a quick invsqrt with a doom like fast inv sqrt which is more for game development where you only care about 1-2 decimal points of precision in some cases.

You can find it here.

Anyways at minimum I'm going to make a library that holds them for my stuff, but I think they would be very valuable for the std lib.

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.standard libraryThis issue involves writing Zig code for the standard library.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions