   triangle question
  how would i check if a point is inside a triangle in 2d.  Is there any easy way or am i going to have to do it with Trig? 
  oh yeah i should mention it''s just a axis alinged cube cut down the diagonal. ;  Found via google, knowing what to search for ("barycentric coordinates"):http://graphics.cs.ucdavis.edu/GraphicsNotes/Barycentric-Coordinates/Barycentric-Coordinates.html"if a1, a2, a3 are scalars such that a1 + a2 + a3 = 1, then the point P defined by P = a1P1 + a2P2 + a3P3 is a point on the plane of the triangle formed by P1, P2, P3. The point is within the triangle P1P2P3 if 0<=a1,a2,a3<=1. If any of the a''s is less than zero or greater than one, the point P is outside the triangle. If any of the a''s is zero, ... P is on one of the lines joining the vertices of the triangle." (and for completeness, if one of the a''s is one and the others are zero, then P is trivially at a vertex of the triangle.)So now we have equationsa1 * p1x + a2 * p2x + a3 * p3x = Pxa1 * p1y + a2 * p2y + a3 * p3y = Pya1 + a2 + a3 = 1  Solve 3 equations in 3 unknowns, and check the a values against (0,1). Done. 