Coder Social home page Coder Social logo

Comments (2)

bvisness avatar bvisness commented on June 2, 2024

The math functions provided by Handmade Math are those used internally by Handmade Math. We don't actually provide the implementations of any trig functions; they are always a proxy to some underlying implementation.

The HANDMADE_MATH_USE_X defines were designed to give you flexibility in how you use Handmade Math itself, but Handmade Math is not a trig library and we don't intend for it to be. We didn't really intend for users to use the trig functions directly.

That said, I understand why you might find yourself doing so in the process of using the library. We could add ASinF, ATanF, and ATan2F, but in non-stdlib use cases this would require people to provide implementations for these three functions even though they're not actually used by Handmade Math at all. Maybe that's fine, though, since you'd typically have such an implementation close at hand if you already are doing SinF and ACosF?

from handmademath.

occivink avatar occivink commented on June 2, 2024

Thanks for the context, I understand the reasoning.
I do think that if you're doing graphics math you'll need to use directly some trigonometry functions, at which point chances are that you will need all of them (especially atan2 imo). So if you use a non-standard angle representation like turns, you'll need to do some back-and-forth conversions, which I think lowers the value of using this representation in the first place.

If you're concerned about increasing the requirement for non-stdlib cases, maybe these could be defined conditionally, such that users can decide to opt-in?

from handmademath.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.