Retired
Length of the line segment (retired)
532 of 1,154JMurphyWeb
Loading description...
Mathematics
Geometry
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.
"5.1 should equal 5.10"
How can I fix this?
I do it in this way return "%.2f" % length
This comment has been hidden.
I think you are adding the coordinates instead of subtracting them.
Thank U for advice) Now I understand my mistake.
Seems that
is a bit wrong, isn't it "8.66" since, rounded or truncated to 2 decimal places, it comes from
8.660254037844387
? It would be good to give one or two more examples so that one knows what do do.Nope, √74 ≈ 8.60
I don't want to solve the problem for you, but if you google how to find the length of a line segment you will find ample explanation.
Did I ask for a solution? No need to solve for me such an easy kata:-) but rather a need for good glasses!
It's very important to state what array format you are giving us for example it's very easy to assume the format is
[[x1,x2],[y1,y1]]
when infact it is[[x1,y1],[x2,y2]]
Hi, i appreciate the suggestion. Please can you explain why the following line is not clear:
(0,0) and (5,-7) would be [ [ 0 , 0 ] , [ 5, -7 ] ]
(0,0) and (5,-7) are coordinates and therefore of the form (x, y. Happy to change it but im Not on a computer now
I don't know I wasnt thinking correctly in the first place I guess
Python translation kumited.
Thanks! Do I need to do anything?
If you want to you could approve it : )
Here's a link to a tutorial on how to approve (or reject) translations.