Skip to content

Commit

Permalink
Correction formula sshape in fuzzy.c
Browse files Browse the repository at this point in the history
The calculation of the Sshape for when the shape parameter < 0 seems to be incorrect. 

I haven't checked (yet) the other shape formulas

Note; there is another issue I am not sure how to solve. See #930
  • Loading branch information
ecodiv committed Jul 10, 2023
1 parent e32ccce commit 0b17673
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/raster/r.fuzzy.set/fuzzy.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ float fuzzy(FCELL cell)

if (type == SSHAPE) {
m = pow(2, exp(2 * abs(shape)));
return (shape < 0) ? pow(1 - cos(x * PI2), m) : pow(sin(x * PI2), m);
return (shape < 0) ? 1 - pow(cos(x * PI2), m) : pow(sin(x * PI2), m);
}

return -1; /* error */
Expand Down

0 comments on commit 0b17673

Please sign in to comment.