Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE
     ❯   

Vectors

Vectors are 1-dimentional Arrays

Vectors have a Magnitude and a Direction

Vectors typically describes Motion or Force

Vector Notation

Vectors can be written in many ways. The most common are:

v =   
1 2 3

or:

v =   
1
2
3

Vectors in Geometry

Vector

The image to the left is a Vector.

The Length shows the Magnitude.

The Arrow shows the Direction.


Motion

Vectors are the building blocks of Motion

In geometry, a vector can describe a movement from one point to another.

The vector [3, 2] says go 3 right and 2 up.


Vector Addition

The sum of two vectors (a+b) is found by moving the vector b until the tail meets the head of vector a. (This does not change vector b).

Then, the line from the tail of a to the head of b is the vector a+b:

Adding Vectors


Vector Subtraction

Vector -a is the opposite of +a.

This means that vector a and vector -a has the same magnitude in opposite directions:

Adding Vectors



Scalar Operations

Vectors can be modified by adding, subtracting, or multiplying a scalar (number) from all the vector values:

a = [1 1 1]

a + 1 = [2 2 2]

[1 2 3] + 1 = [2 3 4]

Vector multiplications has much of the same properties as normal multiplication:

[2 2 2] * 3 = [6 6 6]

[6 6 6] / 3 = [2 2 2]


Force

Force is a Vector.

Force is a vector with a Magnitude and a Direction.


Velocity

Velocity is a Vector.

Velocity is a vector with a Magnitude and a Direction.



×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Copyright 1999-2024 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.