7 kyu
Surface Area and Volume of a Trapezoidal Prism
179pshp
Loading description...
Fundamentals
Algorithms
Mathematics
Algebra
Geometry
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.
plz add Python) it's not hard
python translation:
https://www.codewars.com/kumite/5e92e10e1608730023e1b0d5?sel=5e92e10e1608730023e1b0d5
Random tests can generate zeroes for any dimension, is that ok?
Changed it so each dimension is at least 1
The Last Frontier: Random Tests!
This comment has been hidden.
Nice work.
May I suggest using smaller numbers for the random tests though?
Math.random()\*1000
should do quite nicely, and keeps the returned values on the order of1e12
, which prevents integer inaccuracies.Volumes ~
1e23
are a bit big. Well, huge. Gargantuan. Astronomical. Gawed they're big!Done!
Also, explanation of length should be added.
To most people, this thing looks like a bar, not a prism, mathematical definition notwithstanding.
I expected a shape with four slanted edges, not two, until Google.
I will change the description to try and make it more clear.
I have provided a link to a picture of the prism with the different lengths labelled, does that make it clear enough? Thanks for the input.
Ought to be good enough. Thanks!
Length of height side is not equal to height.
Your math is wrong, either for calculation of area or volume.
Height is the distance between a and b, which means I have calculated it wrong. I have made the changes.
Please let me know if it now works for you.
Yep. Works.
This comment has been hidden.
Hi, height is the distance between a and b, not the length of the sloped sides. I had calculated it wrong, you were on the right track.
I have made a few changes. Please have another go and tell me if it is more clear and if it works for you. Thanks for the input!
This comment has been hidden.