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

Use degrees instead of radians. #34

Open
chrisgannon opened this issue Jun 1, 2019 · 5 comments
Open

Use degrees instead of radians. #34

chrisgannon opened this issue Jun 1, 2019 · 5 comments
Labels
feature request New feature or request

Comments

@chrisgannon
Copy link

chrisgannon commented Jun 1, 2019

I think it's more familiar and user friendly to rotate elements using degrees.

Is it possible to set an optional global variable like Zdog.useDegrees = true;.

Then any value passed to a rotate property is converted to degrees (currently I have to use my own conversion function).

@desandro
Copy link
Member

desandro commented Jun 2, 2019

Thanks for this feature request. Add a 👍 reaction to this issue if you would like to see this feature added. Do not add +1 comments — They will be deleted.

IMO radians is what native JS uses, so its more straightforward to use them rather than introducing a different unit. That said, yeah, there are a lot of times where I'm already thinking in degrees

@desandro desandro added the feature request New feature or request label Jun 2, 2019
@chrisgannon
Copy link
Author

So rather than have it automatically convert it, is it possible to have it a global variable setting? Of course I can use my own converter - just a nice-to-have! :)

@Neon22
Copy link

Neon22 commented Jun 4, 2019

remember a simple function will do the job:
degrees = 180 * radians / pi
radians = pi * degrees / 180

@chrisgannon
Copy link
Author

@Neon22 Yes I use that already - it would just be nice to be able to set it globally so I don't have to keep manually passing values to it. I'm lazy!

@webocs
Copy link

webocs commented Jun 5, 2019

what about a toRadians function as member of Zdog?

 illo.rotate.y = Zdog.toRadians(180);

Edit:

I submitted a PR for this feature request #47

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Development

No branches or pull requests

4 participants