Graphics Reference
In-Depth Information
Operator
Role Played
+
Sum of scalar, vector, or matrix
-
Subtraction of scalar, vector, or matrix
*
Product of scalar or array
.*
Product of scalar or vector
\
A\B = inv (A) * B, with A and B being matrices
.\
A. \B = [B(i,j) /A (i, j)], with A and B being vectors [dim (A) = dim (B)]
/
b/a = B * inv (A), with A and B being matrices
./
A / B = [A(i,j)/b (i, j)], with A and B being vectors [dim (A) = dim (B)]
^
Power of a scalar or power of the matrix (M p)
.^
Power of vectors (a. ^ B = [A(i,j)B (i, j)], for vectors A and B)
Simple mathematical operations between scalars and vectors apply scale to all elements of the vector according
to the defined operation, and simple operations between vectors are performed element to element. Below is a
specification of these operators:
a = {a1, a2,…, an}, b = {b1, b2,…, bn} c = scale
a + c = [a1 + c a2 + c … an+c]
Sum of a scalar and a vector
a * c = [a1 * c a2 * c … an * c]
Product of a scalar by a vector
a + b = [ a1+b1 a2+b2 … an+bn]
Sum of two vectors
a. * b = [ a1*b1 a2*b2 … an*bn]
Product of two vectors
a. / b = [ a1/b1 a2/b2 … an/bn]
Ratio of two vectors to the right
a. \ b = [ a1\b1 a2\b2 … an\bn]
Ratio to the left of two vectors
a. ^ c = [a1 ^c a2 ^ c… an ^ c]
Vector to a power
c. ^ a = [c ^ a1 c ^ a2 … c ^ an]
c to the a vector
a.^b = [a1^b1 a2^b2 … an^bn]
Vector to a vector power
It must be borne in mind that the vectors must be of the same length and that for the product, quotient, and
power, the first operand is followed by a point (dot).
The following is an example that involves this type of operators.
>> X = [5,4,3]; Y = [1,2,7]; a = X + Y, b = X-Y, c = x * Y, d = 2. * X,...
e = 2/X, f = 2. \Y, g = x / Y, h =. \X, i = x ^ 2, j = 2. ^ X, k = X. ^ y
A =
6 6 10
b =
-4 2-4
Search WWH ::




Custom Search