DEV Community

Autumn
Autumn

Posted on • Originally published at skerritt.blog on

A Short Introduction to Vectors

What is a vector?

A vector is a container where order matters and repititions are allowed. An N-vector has n components (elements), each component called Different values in a vector can be the same, so:

A Short Introduction to Vectors

is entirely possible with Vectors.

A Short Introduction to Vectors

A 2-vector represents 2 dimensional space and a 3-vector represents 3-dimensional space.

Doing maths with vectors

Two vectors can be added like so:

A Short Introduction to Vectors

The resultant is a new vector, called W.

You can only add two vectors if the vectors have the same number of components.

Scalar multiplcation is where you increase every item in a vector by R. Let R be a real number then:

A Short Introduction to Vectors

Vector length can be defined using cardinality. The length of a vector, A, is |A|. The length of a vector has uses this formula:

A Short Introduction to Vectors

If you try to calculate the length of a negative vector, you get the length of the positive vector.

A Short Introduction to Vectors

Another thing to note is:

A Short Introduction to Vectors

To reverse a vector you times each component by -1, making everything negative, and

A Short Introduction to Vectors

Vector Space

Start with some set of numbers such as real numbers, integers, whole numbers, rationals etc.

A Short Introduction to Vectors

The superscript number ontop of a set of numbers such as is the set of all real valued (numbers that are in the real numbers) n-vectors where each component is in the set of Real numbers.

Top comments (0)