Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions Position around a circle

  • Position around a circle

  • Jeremy Wick

    December 3, 2021 at 10:52 pm

    I’m trying to write an expression that would set the position relative to the angle around the circumference of a circle.

    For example (100px circle in middle of comp):

    if angle == 0 or 360
    [50,0]
    if angle == 90
    [100,50]
    if angle == 180
    [50,100]
    if angle == 270
    [0,50]

    This only works for the 90 degree increments, so I’m needing a more elegant/mathematic way of doing this that would work for any angle/degree. Any ideas?

  • Dan Ebberts

    December 4, 2021 at 12:28 am

    Maybe like this:

    angle = effect("Angle Control")("Angle");

    r = 50; // radius

    c = [50,50]; // center

    a = degreesToRadians(angle); // angle in radians

    c + [Math.sin(a),-Math.cos(a)]*r

  • Jeremy Wick

    December 4, 2021 at 2:35 am

    Perfect! This is exactly what I needed.

Viewing 1 - 3 of 3 posts

Log in to reply.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy