Java Geometry Algorithm preprocess(Point2D pa, Point2D pb, Point2D pc)

Here you can find the source of preprocess(Point2D pa, Point2D pb, Point2D pc)

Description

Return false when two of the points are the same, because the area would be 0.

License

Open Source License

Declaration

private static boolean preprocess(Point2D pa, Point2D pb, Point2D pc) 

Method Source Code


//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;
        }
    }
}

Related

  1. plus(Point point1, Point point2)
  2. polarPointAtInfinity(double angle)
  3. polarToPoint(double angle, double fx, double fy)
  4. positiveAngleBetween3Points(Point2D.Double p1, Point2D.Double p2, Point2D.Double p3)
  5. preciseFrontBumperOffset( Point2D.Double sourceLocation, Point2D.Double botLocation)
  6. prodEscalar(Point2D p1, Point2D p2)
  7. project(Point2D sourceLocation, double angle, double length)
  8. project(Point2D.Double sourceLocation, double angle, double length)
  9. projectionFactor(Point pt, Point start, Point stop)