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

Rotations in degrees (Unitful.°) are inexact #196

Open
plut opened this issue Nov 12, 2021 · 1 comment · May be fixed by #197
Open

Rotations in degrees (Unitful.°) are inexact #196

plut opened this issue Nov 12, 2021 · 1 comment · May be fixed by #197

Comments

@plut
Copy link

plut commented Nov 12, 2021

The main reason to define a rotation with an angle in degree is to take advantage of the guaranteed-exact functions cosd and sind, e.g. Angle2d(90°)^4 is guaranteed to be the identity.

With the last version of this package, this is not the case:

julia> r=Angle2d(90°)
2×2 Angle2d{Float64} with indices SOneTo(2)×SOneTo(2)(1.5708):
 6.12323e-17  -1.0
 1.0           6.12323e-17
julia> r.theta
1.5707963267948966

A (relatively simple) fix is replacing the one-parameter type Angle2d{T} by Angle2d{T,A}, where A is the angle type. (However, the bad news is that once this is solved for Angle2d, it needs to be replicated for all other angle-based types).

@plut plut changed the title Rotations in degrees (Unitful.°) Rotations in degrees (Unitful.°) are inexact Nov 12, 2021
@plut
Copy link
Author

plut commented Nov 12, 2021

Here is the PR.

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 a pull request may close this issue.

1 participant