public class vec2 extends vec
http://stanlepunk.xyz/
,
https://github.com/StanLepunK/Rope
a, b, c, d, e, f, g, num, p, q, r, s, t, u, v, w, x, y, z
ALPHA, BLACK, BLANC, BLANK, BLEU, BLOOD, BLUE, BOTTLE, BOUTEILLE, BRIGHTNESS, CARMIN, CARMINE, CARTESIAN, CHAOS, COS, CYAN, DRAW, DYNAMIC, EQUATION, EULER, FIT, FLUID, G, GARNET, GARNET_DEEP, GOLD, GOLD_ANGLE, GOLD_NUMBER, GRAVITY, GRAY_1, GRAY_2, GRAY_3, GRAY_4, GRAY_5, GRAY_6, GRAY_7, GRAY_8, GRAY_9, GRAY_MEDIUM, GREEN, GRENAT, GRENAT_PROFOND, GRIS, GRIS_1, GRIS_2, GRIS_3, GRIS_4, GRIS_5, GRIS_6, GRIS_7, GRIS_8, GRIS_9, GRIS_MOYEN, HUE, JAUNE, MAGENTA, MAGNETIC, MIX, NOIR, NONE, NOTHING, NULL, OR, ORANGE, ORDER, PERLIN, PHI, PINK, PIXEL, POLAR, PURPLE, RANDOM, RANDOM_2, RANDOM_3, RANDOM_4, RANDOM_QUARTER, RANDOM_RANGE, RANDOM_ROOT, RANDOM_X_A, RANDOM_X_B, RANDOM_ZERO, RED, ROOT2, ROSE, ROUGE, SANG, SATURATION, SIN, STAR, STATIC, TAN, TRIG_0, TRIG_1, TRIG_2, TRIG_3, TRIG_4, VERT, VIOLET, WHITE, YELLOW
Constructor and Description |
---|
vec2() |
vec2(float v) |
vec2(float x,
float y) |
vec2(java.lang.String key_random,
float r1) |
vec2(java.lang.String key_random,
float r1,
float r2) |
vec2(java.lang.String key_random,
float a1,
float a2,
float b1,
float b2) |
Modifier and Type | Method and Description |
---|---|
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 |
average()
Average
|
vec2 |
copy()
copy()
return all the component of vec
|
vec2 |
dir()
return mapping vector
|
vec2 |
dir(float a_x,
float a_y) |
vec2 |
dir(vec2 origin) |
float |
dist(vec target) |
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)
Dot
v 0.0.1.1
|
boolean |
equals(float target) |
boolean |
equals(float t_x,
float t_y) |
boolean |
equals(vec2 target) |
float |
heading()
heading is a similar method of PVector
|
vec2 |
jitter(int range) |
vec2 |
jitter(int range_x,
int range_y) |
vec2 |
jitter(vec2 range) |
vec2 |
limit(float max) |
float |
mag() |
float |
mag(vec target) |
float |
magSq()
magnitude or length of Vec2
|
vec2 |
map(float minIn,
float maxIn,
float minOut,
float maxOut) |
vec2 |
map(vec2 minIn,
vec2 maxIn,
vec2 minOut,
vec2 maxOut) |
float |
max_vec()
find the min and the max value in the vector list
|
float |
min_vec() |
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
|
vec2 |
pow(int pow)
POW
|
vec2 |
pow(int pow_x,
int pow_y) |
vec2 |
set_s(float x) |
vec2 |
set_t(float y) |
vec2 |
set_u(float x) |
vec2 |
set_v(float y) |
vec2 |
set_x(float x) |
vec2 |
set_y(float y) |
vec2 |
set(float v) |
vec2 |
set(float[] source) |
vec2 |
set(float x,
float y) |
vec2 |
set(ivec v) |
vec2 |
set(vec v) |
vec2 |
sub(float s) |
vec2 |
sub(float s_a,
float s_b)
Substraction
|
vec2 |
sub(ivec v) |
vec2 |
sub(vec v) |
float |
sum()
sum return the sum of all components
|
vec2 |
tan()
Tangent
|
vec2 |
tan(float a_x,
float a_y) |
vec2 |
tan(vec2 target) |
java.lang.String |
toString() |
random_next_gaussian, random_next_gaussian, random_next_gaussian, random_next_gaussian, version
public vec2()
public vec2(float v)
public vec2(float x, float y)
public vec2(java.lang.String key_random, float r1)
public vec2(java.lang.String key_random, float r1, float r2)
public vec2(java.lang.String key_random, float a1, float a2, float b1, float b2)
public vec2 set(float x, float y)
x
- y
- public vec2 set(float v)
public vec2 set(float[] source)
public vec2 set_x(float x)
public vec2 set_y(float y)
public vec2 set_s(float x)
public vec2 set_t(float y)
public vec2 set_u(float x)
public vec2 set_v(float y)
public float sum()
public vec2 mult(float m_x, float m_y)
public vec2 mult(float m)
public vec2 div(float d_x, float d_y)
public vec2 div(float d)
public vec2 add(float a_a, float a_b)
public vec2 add(float a)
public vec2 sub(float s_a, float s_b)
public vec2 sub(float s)
public float average()
public float dot(vec v)
public float dot(float x, float y)
public vec2 pow(int pow)
public vec2 pow(int pow_x, int pow_y)
public vec2 dir()
public vec2 dir(float a_x, float a_y)
public vec2 tan()
public vec2 tan(float a_x, float a_y)
public float angle()
public float heading()
public float max_vec()
public float min_vec()
public vec2 normalize()
public vec2 map(float minIn, float maxIn, float minOut, float maxOut)
minIn
- maxIn
- minOut
- maxOut
- public float magSq()
public float mag()
public float mag(vec target)
v_target
- public vec2 limit(float max)
max
- public float dist(vec target)
target
- distance between himself and an other vectorpublic vec2 jitter(int range)
range
- intpublic vec2 jitter(int range_x, int range_y)
range_x
- intrange_y
- intpublic 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 vec2 copy()
public java.lang.String toString()
toString
in class java.lang.Object
Processing Library Rope by Stanlepunk. (c) 2019