Vector Operations
Visual guide to vector fundamentals · 벡터 연산 시각 가이드
1. What is a Vector?
A vector is a quantity with both magnitude and direction. In 2D, it's represented as (x, y) — an arrow from the origin to a point.
Vectors are fundamental in game development (character movement, camera direction), physics simulations (force, velocity, acceleration), and data science (feature vectors in machine learning). Every GPS navigation instruction is essentially a vector.
벡터는 게임 개발(캐릭터 이동, 카메라 방향), 물리 시뮬레이션(힘, 속도, 가속도), 데이터 과학(머신러닝의 특성 벡터) 등에서 핵심적으로 사용됩니다.
2. Dot Product
The dot product measures how aligned two vectors are: a·b = |a||b|cos θ. Result is a scalar.
The dot product tells you how much two vectors "agree" in direction. If a·b = 0, the vectors are perpendicular. Game engines use this to calculate lighting angles and collision detection.
내적은 두 벡터가 얼마나 같은 방향인지를 알려줍니다. a·b = 0이면 두 벡터는 수직입니다. 게임 엔진에서 조명 각도와 충돌 감지에 활용됩니다.
3. Cross Product
The cross product produces a vector perpendicular to both inputs. Only defined in 3D: |a×b| = |a||b|sin θ.
The cross product is essential for computing surface normals in 3D graphics (determining which way a polygon faces), calculating torque in physics, and finding the area of parallelograms formed by two vectors.
외적은 3D 그래픽스에서 표면 법선 계산(폴리곤의 방향 결정), 물리학에서 토크 계산, 두 벡터로 이루어진 평행사변형의 넓이 계산에 필수적입니다.
4. Magnitude
The magnitude (length) of a vector v = (x, y) is ||v|| = √(x² + y²). In 3D: √(x² + y² + z²).
Magnitude is used to calculate distances between points. In game physics, you compare magnitudes to check if objects are within range. Tip: comparing squared magnitudes (x²+y²) avoids the expensive square root operation.
크기는 점 사이의 거리를 계산하는 데 사용됩니다. 게임 물리에서 제곱 크기를 비교하면 비용이 큰 제곱근 연산을 피할 수 있습니다.
5. Unit Vector
A unit vector has magnitude 1. Normalize any vector: û = v / ||v||. It preserves direction only.
Unit vectors are used whenever you need "pure direction" without magnitude. In shaders, normalized vectors ensure consistent lighting calculations regardless of distance. The standard basis vectors î, ĵ, k̂ are unit vectors along each axis.
단위벡터는 크기 없이 "순수한 방향"만 필요할 때 사용됩니다. 셰이더에서 정규화된 벡터는 거리에 관계없이 일관된 조명 계산을 보장합니다.