Check if point lies inside triangle
Javascript / ECMAScript 6, 161 159 158 / 152

Javascript:

function $(t,r,i,a,n,g,l,e){b=(-g*l+a*(-n+l)+i*(g-e)+n*e)/2;c=b&lt;0?-1:1;d=(a*l-i*e+(e-a)*t+(i-l)*r)*c;f=(i*g-a*n+(a-g)*t+(n-i)*r)*c;return d&gt;0&amp;&amp;f&gt;0&amp;&amp;d+f&lt;2*b*c}


ECMAScript 6 version (thanks m.buettner, saves 6 characters)

$=(t,r,i,a,n,g,l,e)=&gt;{b=(-g*l+a*(-n+l)+i*(g-e)+n*e)/2;c=b&lt;0?-1:1;d=(a*l-i*e+(e-a)*t+(i-l)*r)*c;f=(i*g-a*n+(a-g)*t+(n-i)*r)*c;return d&gt;0&amp;&amp;f&gt;0&amp;&amp;d+f&lt;2*b*c}


Call it as such (returns true or false):

$(pointX, pointY, v1X, v1Y, v2X, v2Y, v3X, v3Y);


Uses some fancy barycentric coordinate math based on code from this answer. An ungolfed version for your reading enjoyment follows:

function $ (pointX, pointY, v1X, v1Y, v2X, v2Y, v3X, v3Y) {
  var A =  (-v2Y * v3X + v1Y * (-v2X + v3X) + v1X * (v2Y - v3Y) + v2X * v3Y) / 2;
  var sign = A &lt; 0 ? -1 : 1;
  var s = (v1Y * v3X - v1X * v3Y + (v3Y - v1Y) * pointX + (v1X - v3X) * pointY) * sign;
  var t = (v1X * v2Y - v1Y * v2X + (v1Y - v2Y) * pointX + (v2X - v1X) * pointY) * sign;
  return s &gt; 0 &amp;&amp; t &gt; 0 &amp;&amp; s + t &lt; 2 * A * sign;
}