ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Perimeter of ellipse

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Mikael Holmström
Perimeter of ellipse
on Oct 31, 2017 at 8:11:18 am

Hi all,

Is there an expression that, based on the width and height of an elliptical shape, returns its perimeter?

Thanks.
Mikael


Return to posts index

Andrei Popa
Re: Perimeter of ellipse
on Oct 31, 2017 at 10:46:09 am

i don't know of such an expression, but you could use the approximate circumference of elipses geometry formula which is C = 2 * pi * sqrt((a^2+b^2)/2);
So the expression should be something like this
a = thisComp.layer("Ellipse").content("Ellipse 1").content("Ellipse Path 1").size[0]/2;
b = thisComp.layer("Ellipse").content("Ellipse 1").content("Ellipse Path 1").size[1]/2;
2 * Math.PI * Math.sqrt((a*a+b*b)/2);


The expression was added to a slider on a null layer in the same composition as the ellipse layer named Ellipse.

Andrei
My Envato portfolio.


Return to posts index

Mikael Holmström
Re: Perimeter of ellipse
on Oct 31, 2017 at 12:27:21 pm

Thank you! That was exactly what i was looking for.
Mikael


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]