Vector Calculator
Fast, accurate, and free online Vector Calculator tool that runs directly in your browser.
-
1Enter data
Enter content, paste text or load a file from disk. -
2Click the button
The tool will immediately process your data in the browser. -
3Get the result
Copy the finished text or save the file to your device.
return "Result ready in 0.1s";
}
Rate this tool:
Related tools
Other tools you may find useful2D and 3D vector calculator - full vector operations online
Vectors are fundamental objects of mathematics, physics and graphic computer science. The calculator supports 2D (x,y) and 3D (x,y,z) vectors: addition, subtraction, scaling, dot product, cross product, length (norm), angle between vectors and normalization.
Basic vector operations
Addition: (a1,a2,a3) + (b1,b2,b3) = (a1+b1, a2+b2, a3+b3). Subtraction: analogously. Scaling: k·(a1,a2,a3) = (ka1, ka2, ka3). Length (standard): |v| = sqrt(v1² + v2² + v3²). Normalization: v/|v| (unit vector, length = 1). Negation: -v (reverse direction).
Dot Product
a·b = a1·b1 + a2·b2 + a3·b3 (the result is a number, not a vector). Geometric interpretation: a·b = |a|·|b|·cos(θ). If a·b = 0: perpendicular vectors (90°). If a·b > 0: angle < 90°. If a·b < 0: angle > 90°. Applications: angle between vectors, projection, lighting in 3D graphics (Lambert), cosine similarity in ML.
Cross Product
a×b = (a2·b3−a3·b2, a3·b1−a1·b3, a1·b2−a2·b1) – 3D only. Result: a vector perpendicular to both (plane normal). |a×b| = |a|·|b|·sin(θ). Right hand rule: direction of result. If a×b = (0,0,0): parallel vectors or one of them zero. Applications: surface normals in 3D graphics, moments of force in physics.
Applications in physics and graphics
Physics: velocity, acceleration, force, angular momentum (all vectors). Oblique projection: v = v0 + a·t (vector addition). 3D graphics: surface normals (cross product), shading (dot product with light vector). Games: collisions (dot product), AI pathfinding. ML: text embeddings (cosine similarity = dot product normalized).
FAQ
What is a unit vector?
Vector of length 1. Normalization: v̂ = v / |v|. Example: v = (3, 4); |v| = 5; v̂ = (0.6, 0.8). Usage: direction without length information (e.g. direction of movement of an object in a game). Unit vectors in 3D: i=(1,0,0), j=(0,1,0), k=(0,0,1) – space basis.
How to calculate the angle between two vectors?
cos(θ) = (a·b) / (|a|·|b|). θ = arccos(a·b / (|a|·|b|)). In JavaScript: Math.acos(dotProduct / (lenA * lenB)) * (180 / Math.PI). Example: a=(1,0), b=(0,1) → dot=0 → cos(θ)=0 → θ=90°. a=(1,0), b=(1,1) → dot=1 → |a|=1, |b|=√2 → cos(θ)=1/√2 → θ=45°.
How are vectors used in machine learning?
Word embeddings (Word2Vec, GloVe, BERT): each word = vector. Similarity: cosine similarity = dot(a,b)/(|a||b|). Semantic search: search for vector relatives (faiss, Qdrant, Pinecone). Image embeddings: image → vector (CNN, ViT). Recommendation: user vector vs item vectors. LLM context: tokens → vector matrices.
What is the Hadamard product?
Element-wise multiplication: (a1,a2,a3) ⊙ (b1,b2,b3) = (a1·b1, a2·b2, a3·b3). Unlike dot product (dot returns a scalar, Hadamard returns a vector). Application in neural networks: LSTM gates (forget gate, input gate), attention mechanism.
How to draw vectors in Python?
import matplotlib.pyplot as plt; import numpy as e.g. plt.quiver(0, 0, 3, 4, angles="xy", scale_units="xy", scale=1). plt.xlim(-1.5); plt.ylim(-1.5). plt.grid(). plt.show(). Some vectors: plt.quiver with X,Y,U,V arrays. 3D: Axes3D.quiver().
Related tools: matrix calculator, scientific calculator and right triangle calculator.