日本語 English

Vectors

Samples

Create a 3D vector (Vector3D)

Creating a 3D vector
Input
x
X axis
y
Y axis
z
Z axis
Output
out
Direction vector

3D vector structure

3D vector structure
sVectorDirection vector
xX axis
yY axis
zZ axis

Example

Example of creating a 3D vector
Input
x
2.0
y
1.0
z
0.0
Output
out
out.x=2.0
out.y=1.0
out.z=0.0

Addition (vecADD)

Vector addition
Input
a
Vector 1
b
Vector 2
Output
out
Direction vector

Example

Example of vector addition
Input
a
a.x=3.0
a.y=2.0
a.z=1.0
b
b.x=1.0
b.y=4.0
b.z=2.0
Output
out
out.x=4.0
out.y=6.0
out.z=3.0

[Formula]

\[ \overrightarrow{a}+\overrightarrow{b}=(a_x+b_x,\ a_y+b_y,\ a_z+b_z) \]


Subtraction (vecSUB)

Vector subtraction
Input
a
Vector 1
b
Vector 2
Output
out
Direction vector

Example

Example of vector subtraction
Input
a
a.x=3.0
a.y=2.0
a.z=1.0
b
b.x=1.0
b.y=4.0
c.z=2.0
Output
out
out.x=2.0
out.y=-2.0
out.z=-1.0

Formulas

\[ \overrightarrow{a}-\overrightarrow{b}=(a_x-b_x,\ a_y-b_y,\ a_z-b_z) \]


Scalar multiplication (vecMUL)

Scalar multiplication of a vector
Input
vec
Vectors
k
Multiplier
Output
out
Direction vector

Example

Example of scalar multiplication of a vector
Input
vec
vec.x=3.0
vec.y=2.0
vec.z=1.0
k
2.0
Output
out
out.x=6.0
out.y=4.0
out.z=2.0

Formulas

\[ k\overrightarrow{a}=(ka_x,\ ka_y,\ ka_z) \]


Hadamard product (vecMultiply)

Hadamard product of vectors
Input
a
Vector 1
b
Vector 2
Output
out
Direction vector

Example

Example of the Hadamard product of vectors
Input
a
a.x=3.0
a.y=2.0
a.z=1.0
b
b.x=1.0
b.y=4.0
b.z=2.0
Output
out
out.x=3.0
out.y=8.0
out.z=2.0

Formulas

\[ \overrightarrow{a}\odot\overrightarrow{b} = (a_xb_x,\ a_yb_y,\ a_zb_z) \]


Cross product (vecCross)

Vector cross product
Input
a
Vector 1
b
Vector 2
Output
out
Direction vector

Example

Example of the cross product of vectors
Input
a
a.x=3.0
a.y=2.0
a.z=1.0
b
b.x=1.0
b.y=4.0
b.z=2.0
Output
out
out.x=0.0
out.y=-5.0
out.z=10.0

Formulas

\[ \overrightarrow{a} \times \overrightarrow{b}= \begin{pmatrix} a_yb_z-a_zb_y \\ a_zb_x-a_xb_z \\ a_xb_y-a_yb_x \end{pmatrix} \]


Comparison (vecEQ)

Vector comparison
Input
a
Vector 1
b
Vector 2

Example

Example of vector comparison

Formulas

\[ a_x=b_x\ AND\ a_y=b_y\ AND\ a_z=b_z \]


Dot product (vecDot)

Dot product of vectors
Input
a
Vector 1
b
Vector 2
Output
out
Result

Example

Example of the dot product of vectors
Input
a
a.x=3.0
a.y=2.0
a.z=1.0
b
b.x=1.0
b.y=4.0
b.z=2.0
Output
out
13

Formulas

\[ result = a_xb_x+a_yb_y+a_zb_z \]


Norm (vecNorm)

Norm of a vector
Input
a
Vectors
Output
out
Result

Example

Example of the norm of a vector
Input
a
a.x=3.0
a.y=2.0
a.z=1.0
Output
out
3.742

Formulas

\[ result = \sqrt{a_x^2+a_y^2+a_z^2} \]



Comments