Skip to content

Make everything use radians#107

Merged
bvisness merged 7 commits into2-devfrom
radians-all
Apr 6, 2020
Merged

Make everything use radians#107
bvisness merged 7 commits into2-devfrom
radians-all

Conversation

@bvisness
Copy link
Copy Markdown
Member

@bvisness bvisness commented Aug 3, 2019

Resolves #31.

TODO:

  • Add documentation

@bvisness bvisness added this to the Handmade Math 2.0 milestone Aug 3, 2019
@bvisness bvisness changed the title Make everything use radians (and provide an escape hatch) WIP: Make everything use radians (and provide an escape hatch) Aug 3, 2019
@bvisness
Copy link
Copy Markdown
Member Author

@StrangeZak What should the trig functions like HMM_SinF do when HANDMADE_MATH_USE_DEGREES is defined? It feels dirty to me to make trig functions take degrees, but I think it would make sense and be the most consistent.

@bvisness
Copy link
Copy Markdown
Member Author

bvisness commented Aug 19, 2019

Actually, that gets thorny because of how the trig functions are used internally. Should we consider making trig functions "private" in the same way we were considering for HMM_LinearCombineSSE? (#109) I think they should basically be an implementation detail and not something provided by Handmade Math.

@RandyGaul
Copy link
Copy Markdown

For my use cases I would prefer all functions to use one or other between degrees and radians, with no macros to change behavior whatsoever. Macros that opaquely change behavior internally are too complicated compared to their utility value. And instead provide a degree to radians and a radians to degree macro pair, and let the user handle it however they like from there.

@bvisness
Copy link
Copy Markdown
Member Author

The intent is for all functions to use radians, and I'm adding an HMM_ToDegrees function/macro to complete the pair. I would still like to provide a flag to use degrees, but I think to make that happen, we will need to hide our trig functions.

It may be, though, that with the trig functions gone, there just aren't enough uses of angles to justify the existence of Degree Mode.

@bvisness bvisness changed the base branch from master to 2-dev August 19, 2019 15:42
@strangezakary
Copy link
Copy Markdown
Member

@bvisness Is there anything i can do to work towards closing this PR

@bvisness
Copy link
Copy Markdown
Member Author

Hmm, I really don't remember where I left this. Clearly I added a conversion macro and some tests. But coming at it again with fresh eyes, I really don't think it's worth the effort, and I think we should just stick with radians everywhere, the end.

So I guess this branch should be updated to do that?

@strangezakary
Copy link
Copy Markdown
Member

strangezakary commented Nov 13, 2019 via email

@strangezakary
Copy link
Copy Markdown
Member

Id like to get this closed if you can allocate some time towards it :D

@bvisness bvisness changed the title WIP: Make everything use radians (and provide an escape hatch) Make everything use radians Mar 27, 2020
@bvisness bvisness requested a review from strangezakary March 27, 2020 20:04
@bvisness
Copy link
Copy Markdown
Member Author

I think this is good to go.

@strangezakary
Copy link
Copy Markdown
Member

Wooo. Ill give it a review now. This is awesome

@bvisness
Copy link
Copy Markdown
Member Author

Travis isn't working, so I'm trying to sort that out. But the tests are ok locally; hopefully they are for you too.

@bvisness
Copy link
Copy Markdown
Member Author

Travis had an outage, and they're slowly recovering, but it seems that everything is passing.

@bvisness
Copy link
Copy Markdown
Member Author

bvisness commented Apr 1, 2020

@StrangeZak Can you look at this, #113, and #114 when you have a chance?

@strangezakary
Copy link
Copy Markdown
Member

happy to see this done feel free to merge it

@bvisness bvisness merged commit 68d2af4 into 2-dev Apr 6, 2020
@bvisness bvisness deleted the radians-all branch April 6, 2020 14:56
@bvisness bvisness mentioned this pull request Dec 12, 2022
@dev-dwarf dev-dwarf mentioned this pull request Dec 29, 2022
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

Successfully merging this pull request may close these issues.

3 participants