Calculator Inputs
Use 2D, 3D, or 4D vectors. Hidden fields are ignored automatically.
Formula Used
Dot Product: A · B = Σ(AiBi)
Magnitude of a Vector: |A| = √Σ(Ai2) and |B| = √Σ(Bi2)
Cosine of the Angle: cos θ = (A · B) / (|A||B|)
Angle Between Vectors: θ = arccos[(A · B) / (|A||B|)]
Scalar Projection of A onto B: compB(A) = (A · B) / |B|
Vector Projection of A onto B: projB(A) = [(A · B) / |B|2]B
How to Use This Calculator
- Select the vector dimension that matches your problem: 2D, 3D, or 4D.
- Choose whether the angle should be displayed in degrees or radians.
- Set the decimal precision you want for the output values.
- Enter every active component for Vector A and Vector B.
- Click Calculate Vector Cosine to display the result block above the form.
- Review cosine, angle, dot product, magnitudes, projections, and the full working steps.
- Use Download CSV for spreadsheet-style output or Download PDF for a clean report.
Example Data Table
| Dimension | Vector A | Vector B | Dot Product | |A| | |B| | Cos θ | Angle (°) |
|---|---|---|---|---|---|---|---|
| 3D | (3, -1, 4) | (2, 2, 1) | 8 | 5.0990 | 3.0000 | 0.5230 | 58.4746 |
| 2D | (5, 0) | (0, 7) | 0 | 5.0000 | 7.0000 | 0.0000 | 90.0000 |
| 4D | (1, 2, 3, 4) | (4, 3, 2, 1) | 20 | 5.4772 | 5.4772 | 0.6667 | 48.1897 |
FAQs
1. What does cosine of the vector angle show?
It shows directional similarity. Values near 1 mean vectors point together, 0 means they are perpendicular, and values near -1 mean they point in opposite directions.
2. Why can this calculator not use a zero vector?
A zero vector has magnitude zero. Since cosine and angle formulas divide by vector magnitudes, the calculation becomes undefined when either vector length is zero.
3. Can I use this for 2D, 3D, and 4D vectors?
Yes. Select the matching dimension first. The calculator hides unused component boxes and only processes the active coordinates for that dimension.
4. What is the difference between dot product and cosine?
The dot product is a raw multiplication-and-sum result. Cosine standardizes that result by dividing with both magnitudes, making the comparison independent of scale.
5. What do scalar and vector projections mean?
Scalar projection gives the signed length of one vector along another. Vector projection gives the directional component itself, written as a new vector.
6. Should I choose degrees or radians?
Choose degrees for most school, engineering, and geometry work. Choose radians when your course, formula sheet, or software expects angles in radian form.
7. How accurate are the results?
The calculator uses standard floating-point maths and lets you set the display precision from 0 to 8 decimal places for clean reporting.
8. What can I export from this page?
You can export the current calculated metrics and input vectors as a CSV file or generate a PDF summary for saving, sharing, or printing.