Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Move in an arc motion from one position to another

  • Move in an arc motion from one position to another

    Posted by Jon Date on September 29, 2013 at 3:05 pm

    I’ve been trying to get a layer to move from one position to another position in a semi circle motion. Does any one have any tips for this? For example I have a layer at 100,100 in x,y and the second position is at 1300,1300. I would like the an expression that moves the layer from point A to point B in an arc motion over a period of time. The reason why I don’t just use a motion path is because the second,and then third, fourth position will be random. Any ideas would be very much appreciated.

    Jon Date replied 12 years, 7 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    September 29, 2013 at 11:57 pm

    It depends on the details, but it could look like this:

    p1 = [100,100];
    p2 = [1300,1300];
    dur = 1;

    center = (p1+p2)/2;
    r = length(p1,p2)/2;
    p0 = p1-center;
    a0 = Math.atan2(p0[1],p0[0]);
    a = a0 + linear(time,inPoint,inPoint + dur,0,Math.PI);
    center + [Math.cos(a),Math.sin(a)]*r;

    Dan

  • Jon Date

    September 30, 2013 at 7:56 pm

    Thank you Dan, thats perfect! I’m going to try and understand the math behind it for future use.
    Cheers

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