Package rope.utils

Class R_Utils.Ru

java.lang.Object
rope.utils.R_Utils.Ru
Enclosing class:
R_Utils

public static class R_Utils.Ru extends Object
  • 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

      public static byte in_polygon(vec[] points, vec pos, float marge)
      Parameters:
      points - cloud of points shape the polygon
      pos - of the point must be detected
      marge - distance of the point around the border
      Returns:
      -1 is out / 0 on border / 1 in polygon
    • in_polygon

      public static boolean in_polygon(vec[] points, vec pos)
    • in_segment

      public static boolean in_segment(vec2 start, vec2 end, vec2 point, float range)
    • dist

      public static float dist(float x1, float y1, float x2, float y2)
      Parameters:
      x1 - value x of the first point
      y1 - value y of the first point
      x2 - value x of the second point
      y2 - 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 point
      y1 - value y of the first point
      z1 - value z of the first point
      x2 - value x of the second point
      y2 - value y of the second point
      z2 - value z of the second point
      Returns:
      float distance beween the two points
    • dist

      public static float dist(vec2 a, vec2 b)
      Parameters:
      a - coordinate of the first point
      b - coordinate of the second point
      Returns:
      float distance beween the two points
    • dist

      public static float dist(vec3 a, vec3 b)
      Parameters:
      a - coordinate of the first point
      b - coordinate of the second point
      Returns:
      float distance beween the two points
    • dist

      public static float dist(vec4 a, vec4 b)
      Parameters:
      a - coordinate of the first point
      b - coordinate of the second point
      Returns:
      float distance beween the two points
    • add

      public static vec2 add(vec2 a, vec2 b)
      each element add of each vector mult each one in the order
      Parameters:
      a - vector be added
      b - vector added
      Returns:
      result of the operation
    • add

      public static vec3 add(vec3 a, vec3 b)
    • add

      public static vec4 add(vec4 a, vec4 b)
    • sub

      public static vec2 sub(vec2 a, vec2 b)
      each element substract of each vector mult each one in the order
      Parameters:
      a - vector target
      b - vector must be sub
      Returns:
      result of the operation
    • sub

      public static vec3 sub(vec3 a, vec3 b)
    • sub

      public static vec4 sub(vec4 a, vec4 b)
    • mult

      public static vec2 mult(vec2 a, vec2 b)
    • mult

      public static vec3 mult(vec3 a, vec3 b)
    • mult

      public static vec4 mult(vec4 a, vec4 b)
    • div

      public static vec2 div(vec2 a, vec2 b)
      Parameters:
      a - vector must be divide by b
      b - vector must divide a
      Returns:
      result of the operation
    • div

      public static vec3 div(vec3 a, vec3 b)
    • div

      public static vec4 div(vec4 a, vec4 b)
    • 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

      public static String[] reverse(String[] arr)
    • max

      public static float max(float... list)
    • max

      public static int max(int... list)
    • max

      public static vec2 max(vec2 a, vec2 b)
    • max

      public static vec3 max(vec3 a, vec3 b)
    • max

      public static vec4 max(vec4 a, vec4 b)
    • max

      public static ivec2 max(ivec2 a, ivec2 b)
    • max

      public static ivec3 max(ivec3 a, ivec3 b)
    • max

      public static ivec4 max(ivec4 a, ivec4 b)
    • min

      public static float min(float... list)
      Parameters:
      list -
      Returns:
      Processing min() method
    • min

      public static int min(int... list)
    • min

      public static vec2 min(vec2 a, vec2 b)
    • min

      public static vec3 min(vec3 a, vec3 b)
    • min

      public static vec4 min(vec4 a, vec4 b)
    • min

      public static ivec2 min(ivec2 a, ivec2 b)
    • min

      public static ivec3 min(ivec3 a, ivec3 b)
    • min

      public static ivec4 min(ivec4 a, ivec4 b)