Finding the center of a polygon?
How would i find the center of a polygon with three points?
sorry this is really simple, i just cant seem to find it anywhere
October 05, 2002 07:22 PM
Take the average of its three "vectors"?
C.x = (float)(v1.x + v2.x + v3.x) / 3.0f;
the same for y and z.
C.x = (float)(v1.x + v2.x + v3.x) / 3.0f;
the same for y and z.
(x1 + x2 + ... + xn) / n = x(y1 + y2 + ... + yn) / n = y(z1 + z2 + ... + zn) / n = z
[edited by - Neosmyle on October 5, 2002 8:26:37 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement