function toEq(theta) {
return (u_, v_, target) => {
const u = u_ * 2 * Math.PI;
const v = v_ * 2 * Math.PI;
const torus = cliffordTorus(u, v);
const [[], [rx, ry, rz]] = values;
if (rx) {
const rotXW = rotateXW(theta);
torus.applyMatrix4(rotXW);
}
if (ry) {
const rotYW = rotateYW(theta);
torus.applyMatrix4(rotYW);
}
if (rz) {
const rotZW = rotateZW(theta);
torus.applyMatrix4(rotZW);
}
const projected = project(torus);
target.set(projected.x, projected.z, projected.y);
};
}