wad67, You're welcome, although I also had the code wrong, hence the offset. What you really need is this:
https://www.dropbox.com/s/2nujpt8zcmc02 ... .capx?dl=0
I worked out the maths from this handy youtube vid:
I've added the instance variables "radius" to the flywheel, and "pivotDistance" to the piston, then I calculate those lengths on start - the main reason for doing this is that the exact image-points distances are slightly less than the width ratios for those sprites. It also means we don't have to recalculate the lengths every time the positioning code block runs.
You'll notice that I've added a sprite9 in - this makes it easier for calculating the correct piston angle; you can set it invisible if you like, or you may want to change the graphics to fit with the rest of the engine.