6 kyu
Cartesian neighbors distance
41 of 403febonachi
Description:
Previous Cartesian neighbors kata
In previous kata we have been searching for all the neighboring points in a Cartesian coordinate system. As we know each point in a coordinate system has eight neighboring points when we search it by range equal to 1, but now we will change range by third argument of our function (range is always greater than zero). For example if range = 2
, count of neighboring points = 24
. In this kata grid step is the same (= 1
).
It is necessary to write a function that returns array of unique
distances between given point and all neighboring points. You can round up the distance to 10
decimal places (as shown in the example). Distances inside list don't have to been sorted (any order is valid).
For Example:
cartesianNeighborsDistance(3, 2, 1) -> {1.4142135624, 1.0}
cartesianNeighborsDistance(0, 0, 2) -> {1.0, 1.4142135624, 2.0, 2.2360679775, 2.8284271247}
Fundamentals
Mathematics
Similar Kata:
Stats:
Created | Sep 28, 2017 |
Published | Oct 3, 2017 |
Warriors Trained | 1438 |
Total Skips | 243 |
Total Code Submissions | 2800 |
Total Times Completed | 403 |
Java Completions | 41 |
Python Completions | 125 |
C++ Completions | 59 |
JavaScript Completions | 69 |
Go Completions | 91 |
C# Completions | 39 |
C Completions | 31 |
TypeScript Completions | 24 |
Total Stars | 26 |
% of votes with a positive feedback rating | 90% of 141 |
Total "Very Satisfied" Votes | 117 |
Total "Somewhat Satisfied" Votes | 20 |
Total "Not Satisfied" Votes | 4 |
Total Rank Assessments | 10 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 7 kyu |