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

Trigonometric functions #643

Merged
merged 8 commits into from
Jan 2, 2024

Conversation

mihaubuhai
Copy link
Contributor

Trig functions

This pull request provides implementations (generically) for the basic trig functions: sine, cosine, tangent and cotangent.

Those generic functions come with the condition for the argument (value for which the trig function will be evaluated) / that particular data type to implement Into<f64> and Copy traits.
Also my last 2 functions have been changed to generic types: least_square_aprox and logarithm

The trig functions sine and cosine are evaluated using their MacLaurin expansion, which is very much similar and that's the purpose of the 'template' function in trig_functions.rs file.
Because those trig functions are related to each other, their implementation is found in the same file, trig_functions.rs

@codecov-commenter
Copy link

codecov-commenter commented Jan 1, 2024

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (c522e60) 94.52% compared to head (bd11075) 94.56%.
Report is 1 commits behind head on master.

Files Patch % Lines
src/math/logarithm.rs 66.66% 4 Missing ⚠️
src/math/least_square_approx.rs 96.55% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #643      +/-   ##
==========================================
+ Coverage   94.52%   94.56%   +0.03%     
==========================================
  Files         282      282              
  Lines       22606    22744     +138     
==========================================
+ Hits        21369    21508     +139     
+ Misses       1237     1236       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@siriak siriak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@siriak siriak merged commit bcc9e32 into TheAlgorithms:master Jan 2, 2024
4 checks passed
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.

None yet

3 participants