determinant of 3 points in java
<p>I am creating a java application. I need to calculate the determinant of three point. I have calculated it:</p>

<pre><code>     static int determinant(Point point1, Point point2, Point point3) {
    int x1 = point1.x;
    int x2 = point2.x;
    int x3 = point3.x;
    int y1 = point1.y;
    int y2 = point2.y;
    int y3 = point3.y;
    return (x1 * y2) + (x3 * y1) + (x2 * y3) - (x3 * y2) - (x2 * y1)
            - (x1 * y3);
}
</code></pre>

<p>(I am not good in math)But, I found the following when I searched about it:</p>

<pre><code>public int ccw(int p1, int p2, int p3)
{
return (xPoints[p2] - xPoints[p1])*(yPoints[p3] - yPoints[p1]) - (yPoints[p2] -    yPoints[p1])*(xPoints[p3] - xPoints[p1]);
}
</code></pre>

<p>which one is the correct method? If the first method is the correct one, what does the second method do?</p>
