Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Debugging an expression (square root trouble?)

  • Debugging an expression (square root trouble?)

    Posted by Michael Tammaro on August 14, 2014 at 2:46 pm

    I have a complex expression that I will be applying to hundreds of layers, and there is a bug. Through a bit of experimenting, I’ve deduced that knowing how to fix the bug in the following expression would be sufficient for my needs:

    x0 = 1; y0 = 2; r1 = Math.sqrt((745 – x0)*(745 – x0) + (660 – y0)*(660 – y0)); x = r1 + x0; y =r1 + y0; [x,y]

    Any help would be appreciated!

    Michael Tammaro replied 12 years ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    August 14, 2014 at 3:54 pm

    Somehow you ended up with em dashes instead of minus signs. Try it this way:

    r1 = Math.sqrt((745 – x0)*(745 – x0) + (660 – y0)*(660 – y0));

    Dan

  • Michael Tammaro

    August 15, 2014 at 1:43 am

    Thanks so much, Dan. Initially I had written the expression out in word, then copied it into AE. I tried trying the expression directly into AE, using the default “-” on my keyboard, and the expression worked. I might not have tried that without your feedback, so thanks again.

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