Skip to content

Commit c31602f

Browse files
authored
Merge pull request #131 from MattWenham/master
Provisional fix for Issue #130
2 parents 5c6ff90 + 21c7db5 commit c31602f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/mapDistanceFunctions.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ float euclideanDistanceOnHexagonalPlanarMap(const unsigned int som_x, const unsi
5151
if (ydist & 1) {
5252
xdist += ((y1 & 1) ? -0.5 : 0.5);
5353
}
54-
return sqrt(float(xdist * xdist + ydist * ydist));
54+
return sqrt(float(xdist * xdist + ydist * ydist * 0.75));
5555
}
5656

5757
float euclideanDistanceOnHexagonalToroidMap(const unsigned int som_x, const unsigned int som_y, const unsigned int x, const unsigned int y, const unsigned int nSomX, const unsigned int nSomY) {
@@ -64,7 +64,7 @@ float euclideanDistanceOnHexagonalToroidMap(const unsigned int som_x, const unsi
6464
if (ydist & 1) {
6565
xdist += ((y1 & 1) ? -0.5 : 0.5);
6666
}
67-
return sqrt(float(xdist * xdist + ydist * ydist));
67+
return sqrt(float(xdist * xdist + ydist * ydist * 0.75));
6868
}
6969

7070
float gaussianNeighborhood(float distance, float radius, float std_coeff) {

0 commit comments

Comments
 (0)