Center of a polygon
Hi, I''m trying to find the center of a convex 3d polygon
with n sides. How can I do this? One idea I had is to
take every triangle in the polygon and find the center of
each triangle by taking the intersection of the medians.
Once I have the center of each triangle, I sum up all the
centers and divide by the number of triangles to get the
average, and that point is the center. My first question
is, will this approach work? My second question is, how
do I find the intersection of the medians? I know that
I make two lines going from one vertex to the median of
the opposite side, but how do I find the intersection of
two 3d lines? Thanks in advance!!
----Blah
Nevermind! I found this page:
http://www.psc.edu/~burkardt/geometry.html
Man, whoever wrote that is a life saver! The source code
is in fortran, which I have never used, but it is still
pretty easy to see what is going on.
I haven''t tested the code yet, but I bet it will work.
Sorry for posting the question guys, I guess I should have
looked around some more first. Well, back to
programming...
----Blah
http://www.psc.edu/~burkardt/geometry.html
Man, whoever wrote that is a life saver! The source code
is in fortran, which I have never used, but it is still
pretty easy to see what is going on.
I haven''t tested the code yet, but I bet it will work.
Sorry for posting the question guys, I guess I should have
looked around some more first. Well, back to
programming...
----Blah
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement