I'm trying to rotate an object around only one axis (any arbitrary unit vector, not necessarily x, y or z), based on the quaternion rotation component along the same axis of a specified quaternion rotation.
public void Rotate(Quaternion rotation, Vector3 axis, Vector3 pointToRotateAround)
{
float angle = ?
gameObject.transform.RotateAround(pointToRotateAround, axis, angle);
}
I don't know how to obtain the angle of my quaternion's rotation that is only along the specified axis. I could do it when the axis is y, for example:
public void Rotate(Quaternion rotation, Vector3 pointToRotateAround)
{
gameObject.transform.RotateAround(pointToRotateAround, Vector3.up, rotation.eulerAngles.y);
}
I want to replicate the results of the above, but for any given axis.
I've dug into google trying to find the answer to this but I haven't found a solution. Any help is appreciated.

Quaternionas input?