-
Notifications
You must be signed in to change notification settings - Fork 147
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
Introducing Angle type [Issue #88] #169
Open
jkalias
wants to merge
23
commits into
apple:main
Choose a base branch
from
jkalias:angle-type
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+905
−45
Open
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
b313290
Introduced Angle type [Issue #88]
jkalias c924790
Removed hyperbolic functions
jkalias 437b280
cos(Angle) changed, 270deg stil not giving 0
jkalias bb19809
cos works for all cases
jkalias d4a4c3c
sin(Angle) also works as expected
jkalias f676bc1
removed newline
jkalias bb474f5
more tests for cos and sin
jkalias 2fad678
cos and sin tests along the whole (-π,π) interval
jkalias 4844b2a
tests and implementation for tan
jkalias c5828b8
Strict equality in tests, not approximate
jkalias 2fba7c7
Removed conformance to BinaryFloatingPoint
jkalias 79f5f7a
Added conformance to AdditiveArithmetic and other utilities
jkalias 5f57416
Added AdditiveArithmetic tests
jkalias e09ef7a
Fixed conformance to Equatable, and added range containment functions…
jkalias 131774a
Updated public access modifier style
jkalias 949c9a2
Refactored AngleTests
jkalias 63bdaaf
cos and sin for exact degrees
jkalias acd67fb
exact tan implemented
jkalias 14c520b
inverse trigonometric functions fixed
jkalias 9e7fb84
range containment and distance checks
jkalias 1743914
documentation
jkalias 56c5ffc
Angle type with trig-pi branch (#85)
jkalias 83ba41b
Merge branch 'main' into angle-type
jkalias File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems unfortunate to me that adding two angles specified in degrees incurs rounding error seven times if I want the result in degrees. I think this dedicated type needs to store values given in degrees as-is if it offers such arithmetic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what I intended with my earlier comment, so degrees and radians are stored separately.
#169 (comment)
We could then switch on all operations performed on the
input
and essentially handle three cases:I'm not sure whether people agree on that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 That would yield a superior result in the case of operations performed entirely in degrees or radians.
I wonder if there are alternative designs that can improve the result when working with both degrees and radians. If the type stored both
radians
anddegrees
, for example, then you could store the result of "90 degrees plus 1 radian" exactly. I haven't thought through the remainder of the design, but I offer it for your consideration here.