mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-10-27 06:20:05 +00:00
Math.pow(x, -1) seems to be faster than 1/x on my machine
This commit is contained in:
1 parent
2144da5466
commit
6d67a0747d
1 file changed
+1
-1
+1
-1
@@ -325,7 +325,7 @@ public class PseudoErosionSampler implements NoiseSampler {
|
|||||||
double ldx = x1 - x2;
|
double ldx = x1 - x2;
|
||||||
double ldy = y1 - y2;
|
double ldy = y1 - y2;
|
||||||
|
|
||||||
double invLineLengthSquared = 1 / (Math.pow(ldx, 2) + Math.pow(ldy, 2));
|
double invLineLengthSquared = Math.pow((Math.pow(ldx, 2) + Math.pow(ldy, 2)), -1);
|
||||||
|
|
||||||
double x2dx = x - x2;
|
double x2dx = x - x2;
|
||||||
double y2dx = y - y2;
|
double y2dx = y - y2;
|
||||||
|
|||||||
Reference in new issue
Block a user