Here you can find the source of preprocess(Point2D pa, Point2D pb, Point2D pc)
private static boolean preprocess(Point2D pa, Point2D pb, Point2D pc)
//package com.java2s; import java.awt.geom.Point2D; public class Main { /**//w ww .ja va 2s . c o m * Return false when two of the points are the same, because * the area would be 0. */ private static boolean preprocess(Point2D pa, Point2D pb, Point2D pc) { if ((pa.getX() == pb.getX()) && (pa.getY() == pb.getY())) { return false; } else if ((pa.getX() == pc.getX()) && (pa.getY() == pc.getY())) { return false; } else if ((pb.getX() == pc.getX()) && (pb.getY() == pc.getY())) { return false; } else { return true; } } }