‹
💡
Vectors
· Explanation💡 Explanation
🎓 Deeper Dive — Adults
A vector has magnitude AND direction — represented as a tuple (a₁, a₂, a₃) in 3D.
Magnitude: |a| = √(a₁² + a₂² + a₃²). Add component-wise: (1,2) + (3,4) = (4,6).
Dot product: a·b = a₁b₁ + a₂b₂ + a₃b₃ = |a||b|cos θ — gives a scalar; useful for projection and angle between vectors.
Cross product (3D only): a × b is a vector perpendicular to both, with magnitude |a||b|sin θ. Used for torque, area of parallelograms.