public class vec2 extends vec
ALPHA, ARC, ARGB, BEZIER_VERTEX, BLANK, BOTTOM, BOX, BREAK, BRIGHTNESS, CARTESIAN, CENTER, CHAOS, CIRCULAR, CLOSE, CORNER, CORNERS, COS, CROSS_BOX_2, CROSS_BOX_3, CROSS_RECT, CUBE_LINE, CURVE_VERTEX, DECAGON, DIAGONAL, DIAMETER, DODECAGON, DOWN, DRAW, DXF, DYNAMIC, EAST, ELLIPSE, EQUATION, EULER, FIT, FLOWER, FLUID, FX2D, G, GOLD_ANGLE, GOLD_NUMBER, GRAVITY, HENDECAGON, HEPTAGON, HEXAGON, HORIZONTAL, HOUSE, HSB, HUE, ICOSI_DODECAHEDRON_LINE, JAVA2D, LEFT, LINE, MAGNETIC, MAX_FLOAT, MAX_INT, MIN_FLOAT, MIN_INT, MIX, NONAGON, NONE, NORTH, NORTH_EAST, NORTH_WEST, NOTHING, NULL, OCTOGON, OCTOHEDRON_LINE, OPEN, ORDER, P2D, P3D, PDF, PENTAGON, PERLIN, PHI, PI, PIXEL, POINT, POLAR, QUADRATIC_VERTEX, RADIUS, RAND, RECT, RGB, RGBA, RHOMBIC_COSI_DODECAHEDRON_SMALL_LINE, RIGHT, ROOT2, SATURATION, SCALE, SIN, SOUTH, SOUTH_EAST, SOUTH_WEST, SPHERE, SPHERE_HIGH, SPHERE_LOW, SPHERE_MEDIUM, SQUARE, STAR, STAR_3D, STATIC, SVG, TAN, TAU, TETRAHEDRON, TETRAHEDRON_LINE, TEXT, TOP, TRIANGLE, TRIG_0, TRIG_1, TRIG_2, TRIG_3, TRIG_4, TWO_PI, UP, VERSION, VERTEX, VERTICAL, VIRUS, WEST
ABRICOT, ACAJOU, AMARANTE, AMBRE, ANSI_BLACK, ANSI_BLACK_BACKGROUND, ANSI_BLUE, ANSI_BLUE_BACKGROUND, ANSI_CYAN, ANSI_CYAN_BACKGROUND, ANSI_GREEN, ANSI_GREEN_BACKGROUND, ANSI_PURPLE, ANSI_PURPLE_BACKGROUND, ANSI_RED, ANSI_RED_BACKGROUND, ANSI_RESET, ANSI_WHITE, ANSI_WHITE_BACKGROUND, ANSI_YELLOW, ANSI_YELLOW_BACKGROUND, ARGENT, AUBERGINE, AZUR, BIS, BISTRE, BLACK, BLANC, BLEU, BLOND, BLOOD, BLUE, BOUTEILLE, BRIQUE, BRONZE, BROWN, CAERULEUM, CAFE, CANARD, CANELLE, CAPUCINE, CARMIN, CARMINE, CAROTTE, CELESTE, CERISE, CHAMOIS, CHARTREUSE, CHOCOLAT, CIEL, CITROUILLE, COBALT, COFFEE, COLOMBIN, CORAIL, CYAN, EVEQUE, FRANCE, FUSCHIA, GOLD, GRAY, GRAY_MEDIUM, GREEN, GRENAT, GRIS, GRIS_MOYEN, GUEULES, IMPERIAL, JAUNE, LAPIS_LAZULI, LAVANDE, LILAS, LIME, LIN, LUNE, MAGENTA, MANDARINE, MARRON, MAUVE, MIMOSA, MOON, MOUNTBATTEN, NANKIN, NAPLE, NOIR, NOISETTE, NUIT, OCRE, OCRE_JAUNE, OCRE_ROUGE, OLIVE, OR, ORANGE, OUTREMER, PAYNE, PERLE, PERROQUET, PINK, PISTACHE, POURPRE, PRUNE, PURPLE, RED, ROSE, ROUGE, SANG, SAPIN, SAUGE, SEPIA, SHAKUDOU, SILVER, SINOPLE, SMALT, SOURIS, TAUPE, TILLEUL, TURQUOISE, VERMILLON, VERT, VERT_D_EAU, VERT_DE_GRIS, VESSIE, VIOLET, WHITE, YELLOW, ZINZOLIN
Constructor and Description |
---|
vec2() |
vec2(float v) |
vec2(float[] source) |
vec2(float x,
float y) |
vec2(int[] source) |
vec2(ivec v) |
vec2(vec v) |
Modifier and Type | Method and Description |
---|---|
vec2 |
add_x(float x) |
vec2 |
add_y(float y) |
vec2 |
add(float a) |
vec2 |
add(float a_a,
float a_b)
add float value
|
vec2 |
add(ivec v) |
vec2 |
add(vec v) |
float |
angle()
Calculate the angle of rotation for this vector (only 2D vectors)
|
float |
angle(vec2 target)
return heading angle
|
float |
average()
average of all componentsb
|
boolean |
compare(vec2 target,
vec2 area)
return true if the vector this and vector target are in the same vector area
|
vec2 |
constrain(float min,
float max)
Constrains a value to not exceed a maximum and minimum value.
|
vec2 |
constrain(vec2 min,
vec2 max)
Constrains a value to not exceed a maximum and minimum value.
|
vec2 |
copy()
copy() return all the component of vec
|
vec2 |
cos_wave(int timeline,
float s)
WAVE COSINUS
|
vec2 |
cos_wave(int timeline,
float sx,
float sy) |
vec2 |
dir()
return normal cartesian angle coord
|
vec2 |
dir(float a_x,
float a_y)
return normal cartesian angle coord
|
vec2 |
dir(vec2 origin)
return normal cartesian angle coord
|
float |
dist(vec target)
return distance of the vector or length
|
vec2 |
div_x(float x) |
vec2 |
div_y(float y) |
vec2 |
div(float d) |
vec2 |
div(float d_x,
float d_y)
divide Vector by a float value
|
vec2 |
div(ivec v) |
vec2 |
div(vec v) |
float |
dot(float x,
float y) |
float |
dot(vec v) |
boolean |
equals(float target)
return true if the vector this is equals to float target
|
boolean |
equals(float t_x,
float t_y)
* return true if the vector this is equals to float arguments
|
boolean |
equals(vec2 target)
return true if the vector this is equals to vector target
|
float |
heading()
Calculate the angle of rotation for this vector (only 2D vectors)
|
vec2 |
jitter(int range)
JITTER
|
vec2 |
jitter(int range_x,
int range_y) |
vec2 |
jitter(vec2 range) |
vec2 |
limit(float max) |
float |
mag()
return square root of magnitude or length of vec2
|
float |
mag(vec target)
return mag between this vector and the target
|
float |
magSq()
return square of vec
|
vec2 |
map(float minIn,
float maxIn,
float minOut,
float maxOut) |
vec2 |
map(vec2 minIn,
vec2 maxIn,
vec2 minOut,
vec2 maxOut) |
vec2 |
mult_x(float x) |
vec2 |
mult_y(float y) |
vec2 |
mult(float m) |
vec2 |
mult(float m_x,
float m_y)
multiply Vector by different float value
|
vec2 |
mult(ivec v) |
vec2 |
mult(vec v) |
vec2 |
normalize() |
vec2 |
normalize(vec2 target)
Normalize vector
|
vec2 |
pow(int pow) |
vec2 |
pow(int pow_x,
int pow_y)
return the power result of this vector
|
vec2 |
rand(float max)
random
|
vec2 |
rand(float min,
float max)
random
|
vec2 |
rand(vec2 min,
vec2 max)
random
|
vec2 |
s(float x) |
vec2 |
set_to(int index,
float arg) |
vec2 |
set(float v) |
vec2 |
set(float[] source) |
vec2 |
set(float x,
float y) |
vec2 |
set(int[] source) |
vec2 |
set(ivec v) |
vec2 |
set(vec v) |
vec2 |
sin_wave(int timeline,
float s)
WAVE SINUS
|
vec2 |
sin_wave(int timeline,
float sx,
float sy) |
vec2 |
sub_x(float x) |
vec2 |
sub_y(float y) |
vec2 |
sub(float s) |
vec2 |
sub(float s_a,
float s_b)
sub float value
|
vec2 |
sub(ivec v) |
vec2 |
sub(vec v) |
float |
sum()
sum of all components
|
vec2 |
t(float y) |
vec2 |
tan()
return tangent of the vector direction
|
vec2 |
tan(float a_x,
float a_y)
return tangent of the vector direction
|
vec2 |
tan(vec2 target)
return tangent of the vector direction
|
java.lang.String |
toString() |
vec2 |
u(float x) |
vec2 |
v(float y) |
vec2 |
wave(int timeline,
float s)
WAVE
|
vec2 |
wave(int timeline,
float sx,
float sy) |
vec2 |
x(float x) |
vec2 |
y(float y) |
a, ab, abc, abcd, abcde, abcdef, alp, array, b, blu, bri, c, d, e, f, get_size, gre, hsb, hsba, hue, max, min, p, pq, q, red, rgb, rgba, s, sat, st, stpq, t, u, uv, v, w, ww, www, wwww, wwwx, wwwy, wwwz, wwx, wwxw, wwxx, wwxy, wwxz, wwy, wwyw, wwyx, wwyy, wwyz, wwz, wwzw, wwzx, wwzy, wwzz, wx, wxw, wxww, wxwx, wxwy, wxwz, wxx, wxxw, wxxx, wxxy, wxxz, wxy, wxyw, wxyx, wxyy, wxyz, wxz, wxzw, wxzx, wxzy, wxzz, wy, wyw, wyww, wywx, wywy, wywz, wyx, wyxw, wyxx, wyxy, wyxz, wyy, wyyw, wyyx, wyyy, wyyz, wyz, wyzw, wyzx, wyzy, wz, wzw, wzww, wzwx, wzwy, wzwz, wzx, wzxw, wzxx, wzxy, wzxz, wzy, wzyw, wzyx, wzyy, wzyz, wzz, wzzw, wzzx, wzzy, wzzz, x, xw, xww, xwww, xwwx, xwwy, xwwz, xwx, xwxw, xwxx, xwxy, xwxz, xwy, xwyw, xwyx, xwyy, xwyz, xwz, xwzw, xwzx, xwzy, xwzz, xx, xxw, xxww, xxwx, xxwy, xxwz, xxx, xxxw, xxxx, xxxy, xxxz, xxy, xxyw, xxyx, xxyy, xxyz, xxz, xxzw, xxzx, xxzy, xxzz, xy, xyw, xyww, xywx, xywy, xywz, xyx, xyxw, xyxx, xyxy, xyxz, xyy, xyyw, xyyx, xyyy, xyyz, xyz, xyzw, xyzx, xyzy, xyzz, xz, xzw, xzww, xzwx, xzwy, xzwz, xzx, xzxw, xzxx, xzxy, xzxz, xzy, xzyw, xzyx, xzyy, xzyz, xzzw, xzzx, xzzy, xzzz, y, yw, yww, ywww, ywwx, ywwy, ywwz, ywx, ywxw, ywxx, ywxy, ywxz, ywy, ywyw, ywyx, ywyy, ywyz, ywz, ywzw, ywzx, ywzy, ywzz, yx, yxw, yxww, yxwx, yxwy, yxwz, yxx, yxxw, yxxx, yxxy, yxxz, yxy, yxyw, yxyx, yxyy, yxyz, yxz, yxzw, yxzx, yxzy, yxzz, yy, yyw, yyww, yywx, yywy, yywz, yyx, yyxw, yyxx, yyxy, yyxz, yyy, yyyw, yyyx, yyyy, yyyz, yyz, yyzw, yyzx, yyzy, yyzz, yz, yzw, yzww, yzwx, yzwy, yzwz, yzx, yzxw, yzxx, yzxy, yzxz, yzy, yzyw, yzyx, yzyy, yzyz, yzzw, yzzx, yzzy, yzzz, z, zw, zww, zwww, zwwx, zwwy, zwwz, zwx, zwxw, zwxx, zwxy, zwxz, zwy, zwyw, zwyx, zwyy, zwyz, zwz, zwzw, zwzx, zwzy, zwzz, zx, zxw, zxww, zxwx, zxwy, zxwz, zxx, zxxw, zxxx, zxxy, zxxz, zxy, zxyw, zxyx, zxyy, zxyz, zxz, zxzw, zxzx, zxzy, zxzz, zy, zyw, zyww, zywx, zywy, zywz, zyx, zyxw, zyxx, zyxy, zyxz, zyy, zyyw, zyyx, zyyy, zyyz, zyz, zyzw, zyzx, zyzy, zyzz, zz, zzw, zzww, zzwx, zzwy, zzwz, zzx, zzxw, zzxx, zzxy, zzxz, zzy, zzyw, zzyx, zzyy, zzyz, zzz, zzzw, zzzx, zzzy, zzzz
all, all, all, all, all, all, any, any, any, any, any, any, binary, binary, binary, binary, clamp, clamp, clamp, clamp, equal, equal, equal, equal, equal, equal, equal, equal, file_name, fract, fract, fract, fract, get_os_family, get_os, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThanEqual, greaterThanEqual, greaterThanEqual, greaterThanEqual, greaterThanEqual, greaterThanEqual, greaterThanEqual, greaterThanEqual, hex, hex, hex, hex, index_pixel_array, lessThan, lessThan, lessThan, lessThan, lessThan, lessThan, lessThan, lessThan, lessThanEqual, lessThanEqual, lessThanEqual, lessThanEqual, lessThanEqual, lessThanEqual, lessThanEqual, lessThanEqual, mix, mix, mix, mix, mod, mod, mod, mod, mod, mod, mod, print_err_tempo, print_err, print_tempo, random_next_gaussian, random_next_gaussian, random_next_gaussian, random_next_gaussian, sign, sign, sign, sign, sign, sign, sign, sign, smoothstep, smoothstep, smoothstep, smoothstep, split, split, step, step, step, step, truncate, truncate, unbinary, unhex
public vec2()
public vec2(float v)
public vec2(float x, float y)
public vec2(vec v)
public vec2(ivec v)
public vec2(float[] source)
public vec2(int[] source)
public vec2 set(float x, float y)
x
- y
- public vec2 set(float v)
public vec2 set(float[] source)
public vec2 set(int[] source)
public vec2 set_to(int index, float arg)
public vec2 x(float x)
public vec2 add_x(float x)
public vec2 sub_x(float x)
public vec2 mult_x(float x)
public vec2 div_x(float x)
public vec2 y(float y)
public vec2 add_y(float y)
public vec2 sub_y(float y)
public vec2 mult_y(float y)
public vec2 div_y(float y)
public vec2 s(float x)
public vec2 t(float y)
public vec2 u(float x)
public vec2 v(float y)
public vec2 mult(float m_x, float m_y)
m_x
- m_y
- public vec2 mult(float m)
public vec2 div(float d_x, float d_y)
d_x
- d_y
- public vec2 div(float d)
public vec2 add(float a_a, float a_b)
a_a
- a_b
- public vec2 add(float a)
public vec2 sub(float s_a, float s_b)
s_a
- s_b
- public vec2 sub(float s)
public float dot(vec v)
v
- public float dot(float x, float y)
public vec2 pow(int pow)
pow
- public vec2 pow(int pow_x, int pow_y)
pow_x
- pow_y
- public vec2 normalize()
public vec2 map(float minIn, float maxIn, float minOut, float maxOut)
minIn
- maxIn
- minOut
- maxOut
- public vec2 map(vec2 minIn, vec2 maxIn, vec2 minOut, vec2 maxOut)
minIn
- maxIn
- minOut
- maxOut
- public vec2 jitter(int range)
range
- intpublic vec2 jitter(int range_x, int range_y)
range_x
- intrange_y
- intpublic vec2 rand(float max)
max
- floatpublic vec2 rand(float min, float max)
min
- floatmax
- floatpublic vec2 limit(float max)
max
- public vec2 constrain(float min, float max)
min
- max
- public vec2 constrain(vec2 min, vec2 max)
min
- max
- public vec2 wave(int timeline, float s)
timeline
- ints
- float speed for all vec argpublic vec2 wave(int timeline, float sx, float sy)
timeline
- sx
- sy
- public vec2 cos_wave(int timeline, float s)
timeline
- ints
- float speed for all vec argpublic vec2 cos_wave(int timeline, float sx, float sy)
timeline
- sx
- sy
- public vec2 sin_wave(int timeline, float s)
timeline
- ints
- float speed for all vec argpublic vec2 sin_wave(int timeline, float sx, float sy)
public float sum()
public float average()
public float dist(vec target)
target
- public vec2 dir()
public vec2 dir(float a_x, float a_y)
a_x
- a_y
- public vec2 dir(vec2 origin)
origin
- public vec2 tan()
public vec2 tan(float a_x, float a_y)
a_x
- a_y
- public vec2 tan(vec2 target)
target
- public float angle()
public float angle(vec2 target)
target
- public float heading()
public float magSq()
public float mag()
public float mag(vec target)
target
- public boolean equals(vec2 target)
target
- Vec2public boolean equals(float target)
target
- floatpublic boolean equals(float t_x, float t_y)
t_x
- floatt_y
- floatpublic boolean compare(vec2 target, vec2 area)
target
- area
- public vec2 copy()
public java.lang.String toString()
toString
in class java.lang.Object