HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Triangles...

02-05-2004, 01:55 AM#1
Eriond
How can I calculate the center of a triangle? Where the three of those lines from the middle of each line meet in the center (I can't remember what they're called)... how would I find out the center? I'm currently using a polar offset, offset by half of the average of the distance between point a and b, from point c and the angle is the angle from point a to b from c, divided by two. It should work, but it works like only half the time... Can someone give me a more reliable formula?
02-05-2004, 02:08 AM#2
linkmaster23
Well... you could set 3 points... like so.. X being the unit.

. .
X
.

Now Since you want to find the unit... just set the Position of unit. Then polar offset from that position. That answer it?
02-05-2004, 02:09 AM#3
Eriond
but there's currently nothing insdide the center of the triangle... there's nothing to base it from except from the three verteces... if your method covers this explain in more detail please...
02-05-2004, 02:14 AM#4
linkmaster23
Well, you have to have a point of center in order to use a polar offset. Just do the same thing, just create the unit, any unit, and then make your offsets. Just 3 of them, then if you ever need to recall that point, you can just recall that point by doing, point centered at position of the unit you created. Make sense now?
02-05-2004, 02:16 AM#5
Eriond
But the points are completely variable, I can't pre place units, and I'm polar offsetting from Z... it's like this

Z X
U
Y

I'm offseting from Z...
02-05-2004, 02:21 AM#6
linkmaster23
So the triangle goes up? As in above the unit?
02-05-2004, 02:22 AM#7
Eriond
It's variable... the verteces can be in any place... I've got a method that's sort of working... but if you place them in one formation, it screws up...
02-05-2004, 02:23 AM#8
linkmaster23
If you have AIM or MSN, please IM me. It would be much more efficent.

AIm - DragonslayerXVX

MSN- [email protected]
02-05-2004, 02:23 AM#9
MysticGeneral
What kind of triangle is it? is it a special triangle? Tell me the degrees of each angle of the triangle.
02-05-2004, 02:25 AM#10
Eriond
It's variable. Obviously it all equals up to 180.... everything else is variable... I'll get on MSN, Linkmaster.
02-05-2004, 02:52 AM#11
linkmaster23
Here
02-05-2004, 02:57 AM#12
Eriond
Ok, here's the trigger in full:

Portal Entrance Cast
Events
Unit - A unit enters (Entire map)
Conditions
Portal Ward Equal to (Unit-type of (Entering unit))
Actions
Set EntranceWards[(Number of units in (Units of type Portal Ward))] = (Entering unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in (Units of type Portal Ward)) Equal to 3
Then - Actions
Player - Disable Portal Entrance for (Owner of (Entering unit))
Player - Enable Portal Exit for (Owner of (Entering unit))
Set Hasportal[1] = True
Unit - Create 1 Portal for (Owner of (Entering unit)) at ((Position of (Entering unit)) offset by (((Distance between (Position of (Entering unit)) and (Position of EntranceWards[1])) + (Distance between (Position of EntranceWards[2]) and (Position of (Entering unit)))) / 4.00) towards (((Angle from (Position of (E facing 0.00 degrees
Animation - Play (Last created unit)'s birth animation
Else - Actions

DAMNIT IT STILL DOESN'T COPY THE WHOLE THING!
What it's facing towards is angle between entering & 1 + entering & 2 / 2
02-05-2004, 03:21 AM#13
ubern00b
might i ask exactly what you are doing with this? just out of curiosity id like to see what you are doing with such complex formulas...
02-05-2004, 03:24 AM#14
weaaddar
In a mathamatical sense there is no such thing as a center of a triangle as to find the center of a triangle is a completely meaningless operation.

Much like finding the center a quadralateral is worthless...
02-05-2004, 03:27 AM#15
cangrejo
what do you mean there is no centre? if you split all the angles in 2, and where they cross it's the centre, tada.. :o

edit, you'd need to make an equational solving system for this.... and thats not easy.. :/