# How to get a point to the left/right of a vector

I have a position vector of a point in space and a quaternion for it's rotation. What i'm trying to calculate is a point too the left and a point to the right.

I have the position and rotation(quaternion) of the red dot. What I want is to get the position of the green dots. I have a float value for the distance I want these points to be.

With only the position and rotation is it possible to get a unit direction vector pointing left/right which I can multiply by my float value?

Edit: I also know the original direction vector.

• Do you have the Direction vector and any fixed Vector (like UP)? Oct 18, 2012 at 8:14
• I have the original direction vector. (edited question) Oct 18, 2012 at 8:44

Given only a point and a direction there is no defined 'right' or 'left'.

Imagine being a falling raindrop, which direction is right or left for you in that case?

In order to calculate (or even define) a right or left you need two directions, typically forward and up.

You seem to already have a forward direction, so you need to define a up direction.

right_dir=forward X up  (cross product)
left_dir=-right


As you want unit vectors in these direction, you should of course normalize right & left.

• I know the up direction. I also realized I know the first direction it's facing. Can I use my rotation and the vector to calculate the new forward vector and then do as you have suggested? If I can get the angle I can use the dot product with the original direction to get the new direction I think. Oct 18, 2012 at 8:44
• I assume all this is in 3D. If you have a quaternion, you can apply that to both the original forward direction and original up direction, to give you a new forward and new up. Get the cross product of the two new vectors.
– Ken
Oct 18, 2012 at 8:47
• Excellent, thank you. I'll give it a go and mark it as the answer if it works. Oct 18, 2012 at 8:56
• +1 for "Imagine being a falling raindrop" for both illustrating the point and being sort of poetic. Oct 18, 2012 at 9:12