Operators for vectors

The following list of operators are specific for vector expressions.

Syntax

Description

Example

| expr_vctr |

Magnitude (or norm ) of a vector

| ( 2, 3, 4) |

~ expr_vctr

Unit vector of a vector

~ (2, 3, 4)

expr_vctr1 + expr_vctr2

Addition of two vectors

(2, 3, 4) + (4, 5, 4)

expr_vctr1 - expr_vctr2

Subtraction of two vectors

(2, 3, 4) - (4, 5, 6)

expr_vctr1 * expr_vctr2

Dot product of two vectors. The result is a scalar.

(2, 3, 2)* (4, 5, 6)

expr_vctr1 % expr_vctr2

Cross product of two vectors. The result is another vector.

(2, 3, 3 )- (4, 5, 2)

expr_real * expr_vctr

Scalar multiple of a vector

5 * (3, 4, 5)

expr_vctr / expr_real

Division by a scalar

(3, 4, 4 ) / 5

expr_vctr . xcom

X-component of a vector

(3, 4, 5 ) . xcom == 3

expr_vctr . ycom

Y-component of a vector

(3, 4, 5 ) . ycom == 4

expr_vctr . zcom

Z-component of a vector

(3, 4, 5 ) . zcom == 5

Where expr_vctr, expr_vctr1, and expr_vctr2 are any valid vector expressions, and expr_real is any valid real number expression.

Download and open a sample.