master
Jonathan Hager 5 years ago
parent a5e222a02f
commit 72ce42edc8

@ -53,10 +53,15 @@ public class StaticMath {
distance = deltaX;
}
else {
distance = Math.abs(deltaX / (float) Math.cos(angle));
if(Math.abs(deltaX) >= Math.abs(deltaY)) {
distance = Math.abs(deltaX / (float) Math.cos(angle));
}
else {
distance = Math.abs(deltaY / (float) Math.sin(angle));
}
}
return (float) Math.sqrt((float) Math.pow(deltaX, 2) + (float) Math.pow(deltaY, 2));
//return distance;
//return (float) Math.sqrt((float) Math.pow(deltaX, 2) + (float) Math.pow(deltaY, 2));
return distance;
}
}

Loading…
Cancel
Save