#### Archived

This topic is now archived and is closed to further replies.

# Finding the midpoint of a triangle?

This topic is 5573 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Does anybody know how to find the middle point of a triangle in 3-d space? it doesnt have to be the exact middle, just near the middle. thanx in advance. As Kent Brockman says: "ONLY TIME WILL TELL."

##### Share on other sites
Bisect the three angles and see where the lines cross. Ta Da! Simple as

##### Share on other sites
P.S. The faster the better! i need this for a realtime radiosity engine im working on.

##### Share on other sites
Define middle? The center of gravity? The center of the smallest enclosing circle? Center of the biggest enclosed circle?

The middle of two points is the point is their isobarycentric point, so this should be the same for three points :

xM = ( xA + xB + xC ) / 3
yM = ( yA + yB + yC ) / 3

ToohrVyk

##### Share on other sites
Sorry, but im not a bloody mathmatition. can you explain how to do it in terms of a function

As Kent Brockman says:
"ONLY TIME WILL TELL."

##### Share on other sites
Ok, I''ll rephrase the question: If I have 3 sets of 3 co-ordinates representing 3 points of a triangle in 3d space, how can i create a function that will spit out 3 co-ordinates that represent the mid-point of that triangle?

As Kent Brockman says:
"ONLY TIME WILL TELL."

##### Share on other sites
Almost exactly as was written above. If your function takes in 3 points, p1, p2, and p3, and returns another point p then it is just:

p.x=(p1.x+p2.x+p3.x)/3;

and the same for y and z.

##### Share on other sites
a function would be:
POINT Find_Center (TRIANGLE T){// variablesPOINT center ;// the math and rest of codecenter.x = (T.x[0] +T.x[1] +T.x[2] )/3;center.y = (T.y[0] +T.y[1] +T.y[2] )/3;center.z = (T.z[0] +T.z[1] +T.z[2] )/3;return center ;}

##### Share on other sites
thank you all. i know how to do it now.
now for a cup of coffee!

As Kent Brockman says:
"ONLY TIME WILL TELL."

##### Share on other sites
The average has some flaws. Imagine a triangle with a very short side, comparatively. The center will be biased towards it.

I would use the center defined by the medians.

Cédric

EDIT: The medians do define a center, do they?

[edited by - Cedric on August 16, 2003 11:25:36 AM]

1. 1
Rutin
64
2. 2
3. 3
4. 4
5. 5

• 16
• 10
• 29
• 20
• 9
• ### Forum Statistics

• Total Topics
633413
• Total Posts
3011759
• ### Who's Online (See full list)

There are no registered users currently online

×