src/main/java/de/javagl/geom/Points.java
/**
     * Creates a comparator that compares points by the angle that the line
     * between the specified center and the point has to the x-axis.
     * 
     * @param centerX The x-coordinate of the center
     * @param centerY The y-coordinate of the center
     * @return The comparator
     */
Creates a comparator that compares points by the angle that the line
between the specified center and the point has to the x-axis.

@param centerX The x-coordinate of the center
@param centerY The y-coordinate of the center
@return The comparator
Creates a comparator that compares points by the angle that the line between the specified center and the point has to the x - axis . @param centerX The x - coordinate of the center @param centerY The y - coordinate of the center @return The comparator
public static Comparator<Point2D> byAngleComparator(
        double centerX, double centerY)
    {
        return new Comparator<Point2D>()
        {
            @Override
            public int compare(Point2D p0, Point2D p1)
            {
                double angle0 = Lines.normalizeAngle(Lines.angleToX(
                    centerX, centerY, p0.getX(), p0.getY()));
                double angle1 = Lines.normalizeAngle(Lines.angleToX(
                    centerX, centerY, p1.getX(), p1.getY()));
                return Double.compare(angle0, angle1);
            }
        };
    }
public static Comparator < Point2D > byAngleComparator ( double centerX , double centerY ) { return new Comparator < Point2D > ( ) { @ Override public int compare ( Point2D p0 , Point2D p1 ) { double angle0 = Lines . normalizeAngle ( Lines . angleToX ( centerX , centerY , p0 . getX ( ) , p0 . getY ( ) ) ) ; double angle1 = Lines . normalizeAngle ( Lines . angleToX ( centerX , centerY , p1 . getX ( ) , p1 . getY ( ) ) ) ; return Double . compare ( angle0 , angle1 ) ; } } ; }
Creates a comparator that compares points by the angle that the line
 between the specified center and the point has to the x-axis.
Creates a comparator that compares points by the angle that the line between the specified center and the point has to the x - axis .
//System.out.println("Angle " 
 //    + Math.toDegrees(angle0) + " and "
 //    + Math.toDegrees(angle1));
