Lesson 2 of 18
3D Cross Product
The Cross Product
The cross product of and produces a new vector perpendicular to both:
Key Properties
- Direction: perpendicular to both and (right-hand rule)
- Magnitude:
- Anti-commutative:
- If and are parallel:
Geometric Meaning
The magnitude equals the area of the parallelogram spanned by and .
Memory Aid: The Determinant Formula
Expanding along the first row gives the formula above.
Applications
- Normal vectors to planes and surfaces
- Torque:
- Area of triangles and parallelograms in 3D
Your Task
Implement void cross3(double ax, double ay, double az, double bx, double by, double bz, double *rx, double *ry, double *rz) that writes the cross product into the output pointers.
TCC compiler loading...
Loading...
Click "Run" to execute your code.