The Rot is the main class and implements the quaternion maths, to use this class you first create a Rot object using one of the constructors.

The ones I most commonly use are

public Rot(RotOrder order, float alpha1, float alpha2, float alpha3)

public Rot(PVector axis, float angle)

public Rot(PVector u, PVector v)

Step 1 creating the Rot object:-

Constructor 1 is used when you know the angles of rotation about each of the three axises, XYZ. The RotOrder object is used to specify the order of rotations in the parameters.

Rot r = new Rot(RotOrder.XYZ, angleX, angleY, angleZ);

Constructor 2 is used to apply a rotation about an arbitary axis specified by the PVector e.g. 1,0,0 is the x axis but 1,1,1 would be the diagonal in a cube.

Rot r = new Rot(axis, angle);

Constructor 3 is useful if you know that you want to rotate a vector from u to v then apply this to other vectors. For instance you want to rotate so that the Y axis is along the diagonal of a cube then u=(0,1,0) and v=(1,1,1)

Rot r = new Rot(u, v);

Step 2 using the roattion

Now that you have a Rot object lets assume you have an array of PVector(s) called
lines that you want to apply this rotation to.

for(int i = 0; i < lines.length; i++){

r.applyTo(lines[i]);

}

The RotOrder class is a utility class when you are working with Euler angles and is used with the method

public float[] getAngles(RotOrder order)

which returns an array of the XYZ rotations represented by the quaternion int the prder specified by the RotOrder object.

Note all angles are in radians.

HTH