Tricky Geometry...

Blitz3D Forums/Blitz3D Programming/Tricky Geometry...

take the distance between any two points in the triangle and find the midpoint(call that x). then find the midpoint between the x and the other point in the triangle. that should give you the midpoint of the triangle. :)

(and i agree with floyd. the centre is only equidistant if it is an equilateral or isosceles triangle)

_________________
``==--..,..--==``

imagine that being a triangle. the centre is not equidistant

example for finding centre of triangle
ax=0
ay=0
az=0

bx=10
by=0
bz=0

cx=5
cy=10
cz=0



temp_mid_point_x=ax-((ax-bx)/2)
temp_mid_point_y=ay-((ay-by)/2)
temp_mid_point_z=az-((az-bz)/2)

actual_mid_point_x=temp_mid_point_x-((temp_mid_point_x-cx)/2)
actual_mid_point_y=temp_mid_point_y-((temp_mid_point_y-cy)/2)
actual_mid_point_z=temp_mid_point_z-((temp_mid_point_z-cz)/2)

Print "midpoint of triangle ("+actual_mid_p troint_x+","+actual_mid_point_y+","+actual_mid_point_z+")"