# Vector Arithmetic

# + and - operators

<p class="callout info">**What**: Addition and Subtraction of Vectors   
**Why**: Detailed computations   
**Time To Complete**: 2 hours </p>

#### [![cc.png](https://wiki.compclassnotes.com/uploads/images/gallery/2026-05/scaled-1680-/cc.png)](https://wiki.compclassnotes.com/uploads/images/gallery/2026-05/cc.png)  


#### +

```diff
//+ addition ;

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

show v1;

save as addition;
```

Output:

```diff
"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 <span style="background-color: rgb(251, 238, 184);">Right Hand Side </span>to <span style="background-color: rgb(251, 238, 184);">Left Hand Side</span>

'**{ }**' : curly brackets, <span style="background-color: rgb(251, 238, 184);">enclosing</span> 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, <span style="background-color: rgb(251, 238, 184);">separating</span> 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

#### -

```diff
//- subtraction ;

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

show v1;

save as subtraction;
```

Output:

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

#### Properties

##### 0-vector

```diff
//+ 0 ;

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

show v1;

save as subtraction;
```

Output:

```
"v1" → {a, b, c}
```

```diff
//- 0 ;

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

show v1;

save as subtraction;
```

Output:

```
"v1" → {a, b, c}
```

**<span style="color: rgb(230, 126, 35);">© 2012-Present CCN Studios</span>**

**<span style="color: rgb(230, 126, 35);">Creative Commons Attribution-NonCommercial-ShareAlike 4.0</span>**

# *: Scale Factor

<p class="callout info">**What**: Scale a vector  
**Why**: Computations to alter the length and direction of a vector  
**Time To Complete**: 1-3 hours</p>

#### [![cc.png](https://wiki.compclassnotes.com/uploads/images/gallery/2026-05/scaled-1680-/cc.png)](https://wiki.compclassnotes.com/uploads/images/gallery/2026-05/cc.png)

<span style="white-space: pre-wrap;">Multiply a vector by a numeral from the </span>**left**.

```
v  =  5.4 * {x,y};

show  v;

save as scale;
```

<span style="white-space: pre-wrap;">Multiply a vector by a numeral from the </span>**right**.

```
v  =   {x,y}*5.4;

show  v;

save as scale;
```

Output

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

**u**<span style="white-space: pre-wrap;"> ought to be a variable/symbol or a numeral. </span>**u**<span style="white-space: pre-wrap;"> cannot be another vector.</span>

```
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

<p class="callout info">**What**: Negative scale factor  
**Why**: How to reverse a vector to point in the opposite direction  
**Time To Complete**: 1-3 hours</p>

#### [![cc.png](https://wiki.compclassnotes.com/uploads/images/gallery/2026-05/scaled-1680-/cc.png)](https://wiki.compclassnotes.com/uploads/images/gallery/2026-05/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](https://wiki.compclassnotes.com/uploads/images/gallery/2026-05/scaled-1680-/negative-scale.jpg)](https://wiki.compclassnotes.com/uploads/images/gallery/2026-05/scaled-1680-/negative-scale.jpg)