wo = effect("WheelOffset")("Angle"); // arbitrary angle control for fine tuning Cxy = thisComp.layer("Tandem").effect("RearWheelContactPoint")("Point"); // C in the diagram Axy = transform.position; // hinge point: A Bxy = effect("WheelPoint")("Point"); // Rear wheel contact point: B Dxy = thisComp.layer("TrailerWheelGuide").transform.position; // trailer wheel guide: D c = length(Axy, Bxy); theta = Math.atan2(Dxy[1]-Cxy[1], Dxy[0]-Cxy[0]); sintheta = Math.sin(theta); costheta = Math.cos(theta); xs = Axy[0] - Cxy[0]; ys = Axy[1] - Cxy[1]; alpha = Math.asin(((sintheta * xs) - (costheta * ys)) / c) + theta; radiansToDegrees( alpha ) + wo;