Skip to content

Conversation

SabariGanesh-K
Copy link
Contributor

@SabariGanesh-K SabariGanesh-K commented Sep 30, 2020

Added Area for Rhombhus

Describe your change:

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.
  • All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
  • If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.
Added Area for Rhombhus
@TravisBuddy
Copy link

Hey @SabariGanesh-K,
Something went wrong with the build.

TravisCI finished with status errored, which means the build failed because of something unrelated to the tests, such as a problem with a dependency or the build process itself.

View build log

TravisBuddy Request Identifier: aace97d0-0338-11eb-8abf-036a378110f7
Added rhombhus area. And fixed some gaps error.
@TravisBuddy
Copy link

Hey @SabariGanesh-K,
Something went wrong with the build.

TravisCI finished with status errored, which means the build failed because of something unrelated to the tests, such as a problem with a dependency or the build process itself.

View build log

TravisBuddy Request Identifier: a65e5a80-033a-11eb-8abf-036a378110f7
Added Rhombhus area.
@SabariGanesh-K
Copy link
Contributor Author

I have added a new shape for Area. All checks have been passed :)

@poyea
Copy link
Member

poyea commented Oct 3, 2020

When I type Area for Rhombus into Google, it asks for 2 diagonals. I guess this is the more accepted version of it right?

maths/area.py Outdated
return pi * radius ** 2


def area_rhombhus(base: float, height: float) -> float:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
def area_rhombhus(base: float, height: float) -> float:
def area_rhombus(base: float, height: float) -> float:
maths/area.py Outdated
"""
if base < 0 or height < 0:
raise ValueError("area_rhombhus() only accepts non-negative values")
return 1 / 2 * base * height
Copy link
Member

Choose a reason for hiding this comment

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

Probably make it take two diagonals as parameters.

@poyea poyea self-assigned this Oct 3, 2020
@poyea poyea added the hacktoberfest-accepted Accepted to be counted towards Hacktoberfest label Oct 3, 2020
Fixed suggested changes
Copy link
Member

@poyea poyea left a comment

Choose a reason for hiding this comment

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

Thank you for your pull request!🤩

@poyea poyea merged commit fb9b9ec into TheAlgorithms:master Oct 4, 2020
stokhos pushed a commit to stokhos/Python that referenced this pull request Jan 3, 2021
* Update area.py Added Area for Rhombhus * Update area.py Added rhombhus area. And fixed some gaps error. * Update area.py Added Rhombhus area. * Update area.py Fixed suggested changes
Panquesito7 pushed a commit to Panquesito7/Python that referenced this pull request May 13, 2021
* Update area.py Added Area for Rhombhus * Update area.py Added rhombhus area. And fixed some gaps error. * Update area.py Added Rhombhus area. * Update area.py Fixed suggested changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktoberfest-accepted Accepted to be counted towards Hacktoberfest

3 participants