5 kyu
The Captain's Distance Request
660 of 699rczerny
Loading description...
Algorithms
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.
I like this one, because it brings me back to my sea-going years. :-) Note that TRUE nauticals never use notation degrees / minutes / seconds, but degrees, minutes and their decimals. Like this: 51-48.3 N 004-54.4 W And a captain will usually prefer a loxodromic course, especially for small distances, to avoid minute course changes every fifteen minutes or so.
Well, let's just assume that Captain Haversine is a pirate and goes by his own rules :)
... and that's why it's important to have domain experts when working on software :)
Fantastic kata that really learns you something!
I also enjoyed it very much.
Missing random tests for CoffeeScript
Needs sample and random tests.
Fixed for JS, need to fix for CoffeScript
Mostly fixed, will raise separate detailed issue on what's still missing.
I think this is kata on 4 kyu.
Basic tests for JS are missing, there's just a default CW template.
Added.
Fun little kata! I'm a big math geek, and I learned some new things with this one. And this kata got me up to 1kyu, so thanks!
Now good luck at getting to
1dan
:Pso which kata made you 1dan? ;-)
This comment has been hidden.
I think you have to be more clear of why you put " and ' signs... I was wondering around!
Info added to description.
This comment has been hidden.
Great article!
This is my favourite kata so far!!
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
CoffeeScript translation added. Please approve.
Approved, but needs to be fixed.
Fixed, but needs random tests.
These rounding instructions make this kata quite difficult! While I'm sure they were intended to allow for a wider range of acceptable answers, the whole "round to the lower 10km" strategy effectively means that come to nearly the exact same answer as the test.
For example: Say the test case's desired estimate is 9000.001km. It will round that to 9000km. If I calculate 8999.999km, then I have to round (or truncate) that to 8990km, which leads to an unaccepted answer, even though my true estimate was only .002km from the test case's estimate.
I think a better strategy would be to have the kata instructions dictate to round to the nearest 10km, or to just allow a certain margin of error.
Rounding requirement has been removed.
This comment has been hidden.
It took a while but this one is now out of beta!
This comment has been hidden.
Nice kata!
Thank you for the Feedback, xcthulhu! I will clarify my kata description further!
I updated the description. Hopefully, it is a little bit clearer now! Cheers!
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
@jakber: Actually, a more numerically stable way of calculating solid angle between two unit vectors
a
andb
on S^3 isatan2(a x b, a . b)
, if you are going to go with the 3D trig solution