6 kyu
Area of an n-sided polygon
233sanfe
Loading description...
Geometry
Algebra
Mathematics
Fundamentals
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Isn't this a hard kata for 6kyu?
I don't feel it takes quite few time to be solved
Fork to resolve below issues.
Missing solution and test framework imports
Custom error messages saying
"Failed"
are useless and should be removed.The preloaded stuff should be moved to fixture.
The user can modify the input.
This comment has been hidden.
wait are the polygons not regular?
yeh, but there is this this theorem called shoelace that lets you easily get the area of any polygon given the points regular or not regular.
I passed all tests but one with a quite a quite large difference , and it is not a rounding issue How can it be possible ?
Edit : found the reason : the n sided polygon is not convex ..... so my code is not adapted
Approved.
There was quite a similar kata but this one is of 2016 and that is of 2019.
Test case not working...message: Traceback: in in area_polygon TypeError: 'int' object has no attribute 'getitem'
Yet, when I submit, it passed. Otherwise, kata quite fun
Not an issue
I would suggest more extensive tests, also with random cases.
I've just added more test case, mainly feeding it with the regular polygons up to 100 sides (but with a random side)
Great, thanks!
This comment has been hidden.
Thank you, I'm modifying the test case