# How can I rotate the two endpoints of a line around the line's center in 3d?

The object is a capsule. I have the position of the object vector3, and the orientation of the object, a quaternion. I want to construct a line which goes through the middle of the capsule with the two endpoints of the line being the top and bottom.

The capsule can be rotated in all 3 dimensions.

top = centerPosition + orientation * (new Vector3(0, halfHeight, 0));

(Here I'm assuming quaternion * vector is evaluated as $$\q v q^{-1}\$$, rotating the vector by the quaternion)