AccuOrtho Logo

RotateInPlane Function Visualization

Function Purpose: RotateInPlane rotates a vector within a 2D plane defined by two vectors. The function takes a base vector (defines u-axis), an auxiliary vector (helps define the plane), and a rotation angle. The result is the base vector rotated by the specified angle within the plane formed by these vectors.
Core Formula:
rotatedVec = cos(θ) × u + sin(θ) × v
where u = normalized(baseVec), v = normalized(projection of apAxis orthogonal to u)

Base Vector (Red)

5.0
0.0
0.0

AP Axis Vector (Blue)

0.0
5.0
2.0

Rotation Control

u (normalized base)

-

v (normalized projection)

-

Rotated Vector

-

Step-by-Step Process:

Step 1: Normalize base vector → -
Step 2: Project apAxis onto plane orthogonal to u → -
Step 3: Normalize projection to get v → -
Step 4: Apply rotation formula → -
Step 5: Scale to original magnitude → -