0
$\begingroup$

Writing a computer graphics related program, I cant figure out how to solve the following problem:

In a 3D space, I have given:

  • 3 distinct points, that describe a plane.
  • 2 of those points describe a line (inside the plane).

I am now looking for:

  • The vector that is orthogonal to the line, and also lies inside the plane.

As I use the resulting vector as the rotation axis of a quaternion rotation, the direction (positive/negative) or length doesnt matter. How can I calculate this vector?

Thanks in advance!

1 Answers 1

1

You can use the cross product. If your points are $A, B$, and $C$ and you want a vector in the plane of these three perpendicular to $AB$, you can use $d = AB \times AC$ to be a vector perpendicular to both. Then $e=AB \times d$ will be in the plane (as it is perpendicular to $d$) and perpendicular to $AB$. Did you want to require that $e$ go through $C$ as well?

  • 0
    @PhilipDaubmeier: Glad to help. I now recall there is an identity that may help, found at http://en.wikipedia.org/wiki/Triple_product that $a\times (a \times b)=a (b \cdot a) - b (a \cdot a)$ which may make it cleaner2012-04-03