Page 1 of 1

Help me find the center of a triangle

Posted: November 3rd, 2004, 11:33 am
by Resbot
I never took a trigonometry class so I need some help.

I know how to find the center point between two points, but I want to know how to find the center between three points, or for that matter, any number of points. How can I do this using expressions applied to the position of a null object?

Thanks!

Posted: November 8th, 2004, 4:35 am
by Paul Tuersley
Wouldn't this just be a case of adding all the points together then dividing by the number of points, no trigonometry required?

For example:
point1 = thisComp.layer("Null 1").position;
point2 = thisComp.layer("Null 2").position;
point3 = thisComp.layer("Null 3").position;
(point1 + point2 + point3) / 3;

whoa

Posted: November 8th, 2004, 12:45 pm
by Resbot
For some reason I never thought it would be that simple. Thanks very much!