I am drawing lines on the screen. Each line has a point
(x,y,z) and a direction
(u,v,w). I want to draw arrow heads on these lines, like two lines that start from
(x,y,z) and leave at a
15 degree angle.
I know how to draw these arrow head lines. I do this by rotating
15 degrees on some axis of rotation which is perpendicular to
(u,v,w). The problem is the axis of rotation I am using is not making all my graphs look good.
Basically I'm given a unit vector
0 and I just use
(1,0,0) which is a unit vector and perpendicular to
If that is not the case, then I use
(v, -u, 0) which is not a unit vector but is perpendicular. Then I normalize it. The norm won't be
|w| < 1 which means
u^2 + v^2 != 0.
This gives ok results. But some tests, the arrow head lines look a bit messed up, or not even looking like a
15 degree angle from the main line.
Does anyone know a good way to find a good perpendicular unit vector to
(u,v,w) so the results will always look good?