Is there any mathmatical function to get any of orthogonal vector from a given vector?

Hello everyone.

Actually, I'm trying to find a mathmatical function to get the one orthogonal vector from a given vector.

Although I can make a function for my purpose, but It would be better to use the provided method in OCCT.
If exists.

Please share your knowledge!!

Regards,
David.

Mikhail Sazonov's picture

The simplest method is to use the axes of coordinate system. See the class gp_Ax2.

Example:

gp_Dir GetOrt (const gp_Dir& theVec)
{
  gp_Ax2 anAxes;
  anAxes.SetDirection (theDir);
  return anAxes.XDirection();
}