# Vector

A vector has a magnitude and direction. The length of the line shows its magnitude and the arrowhead points in the direction. We can add two vectors by joining them head-to-tail. And it doesn't matter which order we add them, we get the same result.

![](/files/-MPCaK9N8yuQv3Tgoxq1)

We can also subtract one vector from another. First, we reverse the direction of the vector we want to subtract, then add them as usual.

![](/files/-MPCaemAHzN8zclZRqNQ)

## **Adding Vector**

We can add vectors by adding the x parts and adding the y part&#x73;**.**

![](/files/-MPCbWTd4LbsOnpHWW5x)

$$
a = (8,13),
b = (26,7),
c = (8, 13) + (26, 7) = (8+26, 13+7) = (34, 20)
$$

## **Magnitude of a Vector**

$$
|a| = \sqrt( x^2 + y^2 )
$$

Magnitude of the vector,$$|b| = (6,8) = \sqrt( 6^2 + 8^2) = \sqrt( 36+64) = \sqrt100 = 10$$&#x20;

## **Multiplying a Vector by a Vector**

* **Dot Product - Result is a Scaler**
  * $$a \cdot b = \lvert a \lvert \times \lvert b \lvert \times cos (\theta)$$&#x20;
  * Multiply the length of a times the length of b, then multiply by the cosine of the angle between a and b.
  * Or, we can use the formula $$a \cdot b = a\_x \times b\_x + a\_y \times b\_y$$&#x20;
  * Multiply the x's, multiply the y's, then add.
* **Cross Product - Results a Vector**
  * Cross Product a × b of two vectors is another vector that is at right angles to both.
  * $$a \times b = \lvert a \lvert \times \lvert b \lvert \times sin (\theta) \times n$$&#x20;

## Polar and Cartesian Coordinates

![](/files/-MPCl7iS93Cv35SvmBXR)

![](/files/-MPClhBo1W9T-3gTpaJ2)

{% embed url="<https://www.mathsisfun.com/algebra/vectors.html>" %}

{% embed url="<https://www.mathsisfun.com/algebra/vectors-dot-product.html>" %}

{% embed url="<https://www.mathsisfun.com/algebra/vectors-cross-product.html>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ai.nuhil.net/vector-and-matrix/scaler-vs-vector.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
