Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions degrees from point date

  • degrees from point date

    Posted by Brennanc on October 31, 2007 at 6:21 pm

    I have 2 animated points that I would like to use to dynamically
    generate an angle in degrees. Assuming that from point A going straight vertical to point B would be 0 degrees regardless of point A’s position relative to the comp.

    Thanks for your help everyone!

    Brennanc replied 18 years, 6 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    October 31, 2007 at 7:07 pm

    Give this a try:

    a = thisComp.layer(“A”);
    b = thisComp.layer(“B”);
    aPos = a.toWorld(a.transform.anchorPoint);
    bPos = b.toWorld(b.transform.anchorPoint);
    delta = bPos – aPos;
    180 – radiansToDegrees(Math.atan2(delta[0],delta[1]))

    Dan

  • Brennanc

    October 31, 2007 at 7:35 pm

    Perfect! Thanks!

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