Skip to content

Commit

Permalink
Merge pull request #484 from jjfumero/fix/math/api
Browse files Browse the repository at this point in the history
TornadoMath double version of trigonometric functions added
  • Loading branch information
jjfumero authored Jul 4, 2024
2 parents 942dc88 + 25764af commit 1ea98b4
Show file tree
Hide file tree
Showing 2 changed files with 214 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@
public class TornadoMath {

public static float min(float a, float b) {
return (a > b) ? b : a;
return Math.min(a, b);
}

public static double min(double a, double b) {
return (a > b) ? b : a;
return Math.min(a, b);
}

public static long min(long a, long b) {
return (a > b) ? b : a;
return Math.min(a, b);
}

public static int min(int a, int b) {
return (a > b) ? b : a;
return Math.min(a, b);
}

public static short min(short a, short b) {
Expand All @@ -64,19 +64,19 @@ public static byte min(byte a, byte b) {
}

public static double max(double a, double b) {
return (a > b) ? a : b;
return Math.max(a, b);
}

public static float max(float a, float b) {
return (a > b) ? a : b;
return Math.max(a, b);
}

public static long max(long a, long b) {
return (a > b) ? a : b;
return Math.max(a, b);
}

public static int max(int a, int b) {
return (a > b) ? a : b;
return Math.max(a, b);
}

public static short max(short a, short b) {
Expand Down Expand Up @@ -384,15 +384,26 @@ public static float atan(float value) {
return (float) Math.atan(value);
}

public static double atan(double value) {
return Math.atan(value);
}

public static float tan(float value) {
return (float) Math.tan(value);
}

public static double tan(double value) {
return Math.tan(value);
}

public static float tanh(float value) {
return (float) Math.tanh(value);
}

public static double tanh(double value) {
return Math.tanh(value);
}

public static float floatPI() {
return (float) Math.PI;
}
Expand All @@ -413,6 +424,10 @@ public static float atan2(float a, float b) {
return (float) Math.atan2(a, b);
}

public static double atan2(double a, double b) {
return Math.atan2(a, b);
}

public static float acos(float a) {
return (float) Math.acos(a);
}
Expand Down Expand Up @@ -465,6 +480,10 @@ public static float toRadians(float angdeg) {
return (float) Math.toRadians(angdeg);
}

public static double toRadians(double angdeg) {
return Math.toRadians(angdeg);
}

public static float sinpi(float angle) {
return (float) Math.sin(angle * Math.PI);
}
Expand Down
Loading

0 comments on commit 1ea98b4

Please sign in to comment.