Vector Arithmetic

+ and - operators

What: Addition and Subtraction of Vectors 
Why: Detailed computations 
Time To Complete: 2 hours 

cc.png

+

//+ addition ;

v1 = {a,2,c}+{1,b,3};

show v1;

save as addition;

Output:

"v1" → {1 + a, 2 + b, 3 + c}

'//' : Comment Operator instructing the Grammarian to ignore its sentence

'v1' : identifier for a variable or variable name

'=': Assignment Operator copying the Right Hand Side to Left Hand Side

'{ }' : curly brackets, enclosing the list of elements in between

'a,2,c' : Elements of the vector enclosed in '{ }' brackets

';' : Delimiter called semicolon indicating the end of a Free Form sentence, separating sentences

'show': textually displays the followed variables

'save as': instructs the Grammarian to save the Free Form script and all its interim computations in cloud objects

-

//- subtraction ;

v1 = {a,2,c}-{1,b,3};

show v1;

save as subtraction;

Output:

"v1" → {-1 + a, 2 - b, -3 + c}

Properties

0-vector
//+ 0 ;

v1 =  {a,b,c}  + {0, 0, 0};

show v1;

save as subtraction;

Output:

"v1" → {a, b, c}
//- 0 ;

v1 =  {a,b,c}  - {0, 0, 0};

show v1;

save as subtraction;

Output:

"v1" → {a, b, c}

© 2012-Present CCN Studios

Creative Commons Attribution-NonCommercial-ShareAlike 4.0

*: Scale Factor

What: Scale a vector
Why: Computations to alter the length and direction of a vector
Time To Complete: 1-3 hours

cc.png

Multiply a vector by a numeral from the left.

v  =  5.4 * {x,y};

show  v;

save as scale;

Multiply a vector by a numeral from the right.

v  =   {x,y}*5.4;

show  v;

save as scale;

Output

"v" → {5.4*x, 5.4*y}

u ought to be a variable/symbol or a numeral. u cannot be another vector.

v  =  u * {a, b, c, d, e, f};

show  v;

save as scale;

Output

"v" → {a*u, b*u, c*u, d*u, e*u, f*u}

Scale Factor < 0

What: Negative scale factor
Why: How to reverse a vector to point in the opposite direction
Time To Complete: 1-3 hours

cc.png

v1  = {1,1};
v2 = -1*v1;

//list of pivots;
pivots = {{0,0}, {0,0}};

//list of vectors;
vectors = {v1,v2};

vectorplot pivots vectors;

save as scale;

Output

negative_scale.jpg