Package rope.utils
Class R_Utils.Ru
java.lang.Object
rope.utils.R_Utils.Ru
- Enclosing class:
R_Utils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic vec2
each element add of each vector mult each one in the orderstatic vec3
static vec4
static float
d_cbrt
(float value, float threshold) static float
d_cos
(float value, float threshold, float ratio) static float
d_normal
(float value, float threshold, float variance, float offset) static float
d_pow
(float value, float threshold, float power) static float
d_sigmoid
(float value, float threshold, float variance) static float
d_sin
(float value, float threshold, float ratio) static float
d_sqrt
(float value, float threshold) static float
dist
(float x1, float y1, float x2, float y2) static float
dist
(float x1, float y1, float z1, float x2, float y2, float z2) static float
static float
static float
static vec2
static vec3
static vec4
static boolean
in_polygon
(vec[] points, vec pos) static byte
in_polygon
(vec[] points, vec pos, float marge) static boolean
in_segment
(vec2 start, vec2 end, vec2 point, float range) static float
map
(float value, float start1, float stop1, float start2, float stop2) map methodstatic float
max
(float... list) static int
max
(int... list) static ivec2
static ivec3
static ivec4
static vec2
static vec3
static vec4
static float
min
(float... list) static int
min
(int... list) static ivec2
static ivec3
static ivec4
static vec2
static vec3
static vec4
static vec2
static vec3
static vec4
static float
random
(float high) static float
random
(float low, float high) float
static float
random_next_gaussian
(float range) static float
random_next_gaussian
(float range, int n) static float
random_next_gaussian
(int n) static boolean[]
reverse
(boolean[] arr) static byte[]
reverse
(byte[] arr) static char[]
reverse
(char[] arr) static double[]
reverse
(double[] arr) static float[]
reverse
(float[] arr) static int[]
reverse
(int[] arr) static long[]
reverse
(long[] arr) static String[]
static <T> T[]
reverse
(T[] arr) static vec2
each element substract of each vector mult each one in the orderstatic vec3
static vec4
-
Constructor Details
-
Ru
public Ru()
-
-
Method Details
-
d_pow
public static float d_pow(float value, float threshold, float power) -
d_sqrt
public static float d_sqrt(float value, float threshold) -
d_cbrt
public static float d_cbrt(float value, float threshold) -
d_normal
public static float d_normal(float value, float threshold, float variance, float offset) -
d_sin
public static float d_sin(float value, float threshold, float ratio) -
d_cos
public static float d_cos(float value, float threshold, float ratio) -
d_sigmoid
public static float d_sigmoid(float value, float threshold, float variance) -
in_polygon
- Parameters:
points
- cloud of points shape the polygonpos
- of the point must be detectedmarge
- distance of the point around the border- Returns:
- -1 is out / 0 on border / 1 in polygon
-
in_polygon
-
in_segment
-
dist
public static float dist(float x1, float y1, float x2, float y2) - Parameters:
x1
- value x of the first pointy1
- value y of the first pointx2
- value x of the second pointy2
- value y of the second point- Returns:
- float distance beween the two points
-
dist
public static float dist(float x1, float y1, float z1, float x2, float y2, float z2) - Parameters:
x1
- value x of the first pointy1
- value y of the first pointz1
- value z of the first pointx2
- value x of the second pointy2
- value y of the second pointz2
- value z of the second point- Returns:
- float distance beween the two points
-
dist
- Parameters:
a
- coordinate of the first pointb
- coordinate of the second point- Returns:
- float distance beween the two points
-
dist
- Parameters:
a
- coordinate of the first pointb
- coordinate of the second point- Returns:
- float distance beween the two points
-
dist
- Parameters:
a
- coordinate of the first pointb
- coordinate of the second point- Returns:
- float distance beween the two points
-
add
each element add of each vector mult each one in the order- Parameters:
a
- vector be addedb
- vector added- Returns:
- result of the operation
-
add
-
add
-
sub
each element substract of each vector mult each one in the order- Parameters:
a
- vector targetb
- vector must be sub- Returns:
- result of the operation
-
sub
-
sub
-
mult
-
mult
-
mult
-
div
- Parameters:
a
- vector must be divide by bb
- vector must divide a- Returns:
- result of the operation
-
div
-
div
-
map
public static float map(float value, float start1, float stop1, float start2, float stop2) map method- Parameters:
value
-start1
-stop1
-start2
-stop2
-- Returns:
- Processing map() method
-
random
public static float random(float high) -
random
public static float random(float low, float high) - Parameters:
low
-high
-- Returns:
- random number, this method is a copy of Processing one
-
random_next_gaussian
public float random_next_gaussian() -
random_next_gaussian
public static float random_next_gaussian(int n) - Parameters:
n
-- Returns:
-
random_next_gaussian
public static float random_next_gaussian(float range) - Parameters:
range
-- Returns:
-
random_next_gaussian
public static float random_next_gaussian(float range, int n) - Parameters:
range
-n
-- Returns:
-
reverse
public static <T> T[] reverse(T[] arr) - Parameters:
arr
- list of any type elements- Returns:
- a reverse list of elements
-
reverse
public static boolean[] reverse(boolean[] arr) -
reverse
public static byte[] reverse(byte[] arr) -
reverse
public static char[] reverse(char[] arr) -
reverse
public static int[] reverse(int[] arr) -
reverse
public static long[] reverse(long[] arr) -
reverse
public static float[] reverse(float[] arr) -
reverse
public static double[] reverse(double[] arr) -
reverse
-
max
public static float max(float... list) -
max
public static int max(int... list) -
max
-
max
-
max
-
max
-
max
-
max
-
min
public static float min(float... list) - Parameters:
list
-- Returns:
- Processing min() method
-
min
public static int min(int... list) -
min
-
min
-
min
-
min
-
min
-
min
-