-
Using expressions to find Chord of circle
Hey,
im trying to attach an object to the bottom of a swinging sign. The anchor point of the sign is at the top so i can make it swing, which means i cant attach the other object to the anchor point. I figured i could use maths to find out the length of the chord on the circle in which the sign would be swinging and use expressions to make the object position itself accordingly.
Im working on positioning it on the z axis however it isnt working at all heres the code, is there and easier way or why isnt the maths working properly?
thanks!
x = (thisComp.layer("page1").transform.xRotation /360) * (2*Math.PI*720);C = (2 * Math.PI * 720);
A = x / C * 360;
L = 720 * Math.sin(A/2) * 2;
thisComp.layer("page1").transform.position + [
0,
736,
L
]