-
Notifications
You must be signed in to change notification settings - Fork 599
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
feat(frontend): Trigonometric functions in degrees #8884
Conversation
Codecov Report
@@ Coverage Diff @@
## main #8884 +/- ##
========================================
Coverage 70.80% 70.80%
========================================
Files 1181 1177 -4
Lines 195755 195234 -521
========================================
- Hits 138602 138234 -368
+ Misses 57153 57000 -153
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 65 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
#[function("sind(float64) -> float64")] | ||
pub fn sind_f64(input: F64) -> F64 { | ||
f64::sin(f64::to_radians(input.0)).into() | ||
} |
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.
The PostgreSQL implementation is nontrivial, as it is intended to be more accurate than conversion first.
Another way to work with angles measured in degrees is to use the unit transformation functions radians() and degrees() shown earlier. However, using the degree-based trigonometric functions is preferred, as that way avoids round-off error for special cases such as sind(30).
For reference, see this.
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.
Thank you very much for pointing that out. Sorry, I did not have time to continue working on this. I will try to introduce the function one by one whenever I have time for it. My first short at Sind
: #9056
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.
Cosd
: #9064
Closing this one. Will break it up in small PRs. Next up is asind |
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
Implement trigonometric functions in degree. Merge after original one #8838
#8806
sind
/cosd
/tand
/cotd
/asind
/acosd
/atand
/atan2d
Checklist For Contributors
./risedev check
(or alias,./risedev c
)Checklist For Reviewers
Documentation
Documents are here: #9678