OK dayglo, here we go.
Here's a picture to go with the formuals:
Variables:
R = length of conrod in [mm]
D = Stroke/2 in [mm]
P = piston position relative to center of crank in [mm]
X = crank pin postition relative to center of crank in [mm]
alpha = crank angle in [deg]
Formulas:
In the picture we can see that:
P = X + T
where
X = D x cos(alpha).
To calculate T we need the help of phytagoras formula that says:
R^2 = T^2 + T2^2
Solve for T and we get:
T = SQRT(R^2 - T2^2)
T2 can also be expressed as:
T2 = D x sin(alpha)
which gives us:
T = SQRT(R^2 - (D x sin(alpha))^2
Finally we get the expression for P as a function of crank angle alpha:
P = D x cos(alpha) + SQRT(R^2 - (D x sin(alpha))^2)
Now you can insert: D = Stroke/2 (but I won't do that, it makes it cluttered to read)
Hope this helps.