If you want to create a circular movement the obvious way would be to rotate your object. Sometimes what you want is to create a circular movement using position transform instead. A case when you would want this is for example if you want to animate a particle emitter in an arc or animate the position of a lensflare. So how can we do this. We´ll use some basic trigonometry functions !. I´ve played around with some trig functions in some earlier posts using flash (I the post Unit Circle I demonstrate the relationship between rotations in degrees and radians and coordinate values.) To refresh my memory I drew a simple sketch of the function I would need to do this. The result I want from this function is a position value ( x and y coordinate). The input this function requires is an Angle attribute and the length of the Radius of the arc.

In After Effects
I created a null object and added an angular and slider control to it. ( Effect > Expression Control ). Then I write my expression in the position property of the object I want to affect. Below is the expression I use. The variable myAngle is used to store the angle of the angle Control and the varaible myDist is used to store the radius of the arc. The myRad variable is used to convert the angle, returned from the angle Control in degrees, to radians. To get the X coordinate I use the cos of the angle in radians multiplied by myDist ( the hypothenuse ) and at the end I add half of the comp size to center the point. To get the Y coordinate I use the sin function instead.
Expression
myAngle = thisComp.layer(“Null 1″).effect(“Rotation”)(“Angle”);
myDist = thisComp.layer(“Null 1″).effect(“Radius”)(“Slider”);
myRad = degreesToRadians(myAngle);myX = Math.cos(myRad)*myDist+thisComp.width*.5;
myY = Math.sin(myRad)*myDist+thisComp.height*.5;[myX,myY]
The last line in an expression in After Effexts is used as the value that is used by the property the expression is assigned to. Since the expression above is used to control the position, an array with two values is expected.If you want to create a circular movement the obvious way would be to rotate your object. Sometimes what you want is to create a circular movement using position transform instead. A case when you would want this is for example if you want to animate a particle emitter in an arc or animate the position of a lensflare. So how can we do this. We´ll use some basic trigonometry functions !. I´ve played around with some trig functions in some earlier posts using flash (I the post Unit Circle I demonstrate the relationship between rotations in degrees and radians and coordinate values.) To refresh my memory I drew a simple sketch of the function I would need to do this. The result I want from this function is a position value ( x and y coordinate). The input this function requires is an Angle attribute and the length of the Radius of the arc.

In After Effects
I created a null object and added an angular and slider control to it. ( Effect > Expression Control ). Then I write my expression in the position property of the object I want to affect. Below is the expression I use. The variable myAngle is used to store the angle of the angle Control and the varaible myDist is used to store the radius of the arc. The myRad variable is used to convert the angle, returned from the angle Control in degrees, to radians. To get the X coordinate I use the cos of the angle in radians multiplied by myDist ( the hypothenuse ) and at the end I add half of the comp size to center the point. To get the Y coordinate I use the sin function instead.
Expression
myAngle = thisComp.layer(“Null 1″).effect(“Rotation”)(“Angle”);
myDist = thisComp.layer(“Null 1″).effect(“Radius”)(“Slider”);
myRad = degreesToRadians(myAngle);myX = Math.cos(myRad)*myDist+thisComp.width*.5;
myY = Math.sin(myRad)*myDist+thisComp.height*.5;[myX,myY]
The last line in an expression in After Effexts is used as the value that is used by the property the expression is assigned to. Since the expression above is used to control the position, an array with two values is expected.
Offset value in time
If you want to offset a value in time simply use the “valueAtTime” function.
For instance if you want to use the position information of “Null 1″ but offset that value by 1 second you can use the following expression:
thisComp.layer("Null 1").transform.position.valueAtTime(time-1);
To make it half the speed you can use this expression:
thisComp.layer("Null 1").transform.position.valueAtTime(time*.5);
![]()