You people talk funny.
hehe :P
Wait, can we work out the area of the triangle? because according to THIS wikipedia article http://en.wikipedia.org/wiki/Incircle#Relation_to_area_of_the_triangle the radius of the incircle is linked to the area of the triangle by the 1st, 2nd and 3rd formulas they give...
SeanCyrusTowel- 01-17-2008
You know what sucks? I'm going into my last semester of my math major, and the only time I have done Trig, is in high school.... They really should stop focusing on how to prove the Square root of two is irrational and focus more on trig ;-)
fatbuoy1- 01-17-2008
Yeh i hated maths, found it extremely boring!
Love this pic...
Anyways Greg, If you take a look at those 3 formulae in that wikipedia post i found, I think they should give you X.
SeanCyrusTowel- 01-17-2008
There are 3 circles that (oh crap I got a C in geometry.... and that was a whole year ago too) can be made in a triangle.... there's one that touches the midpoints of all the lines, one that touches the points of the triangle.... and I don't remember the other. Anyway point is they can all be related to one thing or another inside the triangle.... Triangles are funny and you can work out a lot about them.
I'm just not sure why the area is needed. Although I know when to shut up so I don't look like an idiot.... and that is now :-D
JohnGreenArt- 01-17-2008
If we've learned antying from a certain archaeologist, it's that X never, EVER marks the spot.
fatbuoy1- 01-17-2008
Well as far as my memory and logic serves... Greg's talking about the incircle, where the triangle's sides are all tangents to the circle.
We're trying to find the radius of the circle. If we have the area (A), we can find the semiperimeter (s), then we can use A and s to find the radius... according to those formulae anyway!
fatbuoy1- 01-17-2008
John, I think the final puzzle in Nearly Departed should involve finding the radius of a certain circle stuck inside a certain triangle...
SeanCyrusTowel- 01-17-2008
However, note in the picture that B and C (which I assume are the triangles other sides) are not tanget to the circle, they meet at it's center. That circle is an incircle but not of ABC.... but I suppose it doesn't really matter, as long as you can find it, right?
SeanCyrusTowel- 01-17-2008
John, I think the final puzzle in Nearly Departed should involve finding the radius of a certain circle stuck inside a certain triangle...
Isn't that like "If a tree falls in the woods and no one is around to hear it, what color is the tree?"
No we're not finding the area of the smaller triangle ABC, we'r finding the area of the bigger triangle that the circle's inside... which should be possible with one side and 2 angles shouldn't it?
...and yeah that pdf seems to have the same formulae I found... guess we may just wait for Greg to take a look and tell us if its the right stuff.
Anyways, what am I talking for? I havn't touched a maths book in 2 years!
Oh and Wes, I think the answer is octarine...
SeanCyrusTowel- 01-17-2008
I thought it was "Every color".
I have touched Math books, but like I said before I got a C in Geometry... And I tend to forget everything I learned the next semester anyway.
I can look through some of my old stuff... But I think what you're thinking of with 1 side and two angles is Side-Angle-Side congruence formula... though if we can find a congruent triangle, it would stand to reason we know what the other two sides are, right?
bigmac- 01-18-2008
remember when we did Isle of the Maneaters? Remember how we made links for the doorways that were polygons. Why not look at some sudo code (or something) for a web browser, and see how they figure that information out...
Those being old skool image maps? It's no mystery how those work, nor is it a cutting-edge feature in any way shape or form. :shock:
bigmac- 01-18-2008
Greg, my trigonometry is a little hazy, but does X cut A in half exactly? Because then you can use
c² = a² + b² - 2ab cosC
or in this case,
X² = (A/2)² + C² - 2 (A/2)² (C) (cos r)
to find X?
Yes, X is a bisector but that offers little benefit due to the fact that this is not (necessarily) a regular/right triangle. The only constant is that it's a radius of the incircle. So, lets put this one to bed once and for all... Here's the pic again:
The red points are grid nodes, the black line is a polygon edge, and the blue point is our mouse click that needs to be interpolated. And here's what we know:
- The placement of the three points.
- The distance between each of the three points. (A, B, C)
- The angles created by each of our three points. (q, r, ...)
First we have to extend a triangle from our two grid points that will make our mouse click the incenter. We know two of this new triangle's angles because they are bisected by the click-point triangle (p = q, r = s). Knowing that we can prove the third angle because we know that all angles of a triangle add up to 180. Then we need to find the length of the outer triangle's two unknown sides, which can be done with the Sine Rule; which is:
a/sinA = b/sinB = c/sinC
or inverted for our purposes becomes:
var a:Number = B*Math.sin(A)/Math.sin(B);
once we have all sides of the triangle, we can find the semi-perimeter:
var s:Number = (A+B+C) / 2;
and use that to find the area:
var area:Number = Math.sqrt(s * (s-A) * (s-B) * (s-C));
then finally use that to find the inradius of the incircle:
var inrad:Number = (area*2) / (A+B+C);
That inradius can be used as the basis for -*test*-('")ing an interpolation point across a room's walk-area polygons. By the time we -*test*-('") for a match, we've already ruled out that the point is contained within one of the polygons, so we're safe to assume the nearest point along a polygon edge is what we'll need.
Finally, when plotting the point, I THINK we can just utilize an operation of the Flash Point class. It has a polar() function that will yield a cartisian point based on length and angle (both of which we would have by this time), so that should take care of plotting the target. Of course, the Flash documentation sucks on that command so I'd need to experiment with it before assuming it will work.
Oh and for the record, just because the math is resolved does NOT necessarily mean I'll be implementing it in the engine. Don't get your hopes up. I just love a good geometry proof.
Forumer™ is Voted #1 Free Forum Hosting provider
Build your own community today with the largest message board hosting company.