Help me find the center of a triangle

Moderators: Disciple, zlovatt

Post Reply
Resbot
Posts: 2
Joined: September 7th, 2004, 6:24 am

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!
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

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;
Resbot
Posts: 2
Joined: September 7th, 2004, 6:24 am

For some reason I never thought it would be that simple. Thanks very much!
Post Reply