-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Adding Pythagoras Theorem #1072
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
Conversation
To calculate the hypothenuse, adjacent and base of the triangle
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.
Add some tests for the functions.
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.
Please rename the file to PythagoreanTheorem
.
calcAdjacent
and calcBase
are practically the same function (a = sqrt(c2 - b2)
and b = sqrt(c2 - a2)
) - deduplicate them. Order shouldn't matter for a
and b
(adjacent vs. base).
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.
You've got two tests both for adjacent
& base
calculation. Please merge them in a single function.
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.
added test functions
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.
Looks good enough (would perhaps rename calcOtherSides
to calcOtherSide
since it calculates one other side).
This pull request introduces 1 alert when merging 5cd94d8 into a9e65cd - view on LGTM.com
new alerts:
- 1 for Unused variable, import, function or class
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.
Please use pythagorean triplets as tests. Your current tests are invalid.
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.
4 + 9 = 13; sqrt(13) != 4
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.
16 - 9 = 7; sqrt(7) != 2
To calculate the hypothenuse, adjacent and base of the triangle
Open in Gitpod know more
Describe your change:
Checklist:
Example:
UserProfile.js
is allowed butuserprofile.js
,Userprofile.js
,user-Profile.js
,userProfile.js
are notFixes: #{$ISSUE_NO}
.