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