src/main/java/de/javagl/geom/OrientedBoundingBoxes.java
/**
     * Compute the transform that moves point p0 to the origin,
     * and aligns the line from p0 to p1 with the x-axis
     * 
     * @param p0 The first point
     * @param p1 The second point
     * @return The alignment transform
     */
Compute the transform that moves point p0 to the origin,
and aligns the line from p0 to p1 with the x-axis

@param p0 The first point
@param p1 The second point
@return The alignment transform
Compute the transform that moves point p0 to the origin and aligns the line from p0 to p1 with the x - axis @param p0 The first point @param p1 The second point @return The alignment transform
private static AffineTransform computeAlignmentTransform(
        Point2D p0, Point2D p1)
    {
        double angleRad = Lines.angleToX(p0, p1);
        AffineTransform at = 
            AffineTransform.getRotateInstance(-angleRad);
        at.concatenate(AffineTransform.getTranslateInstance(
            -p0.getX(), -p0.getY()));
        return at;
    }
private static AffineTransform computeAlignmentTransform ( Point2D p0 , Point2D p1 ) { double angleRad = Lines . angleToX ( p0 , p1 ) ; AffineTransform at = AffineTransform . getRotateInstance ( - angleRad ) ; at . concatenate ( AffineTransform . getTranslateInstance ( - p0 . getX ( ) , - p0 . getY ( ) ) ) ; return at ; }
Compute the transform that moves point p0 to the origin,
 and aligns the line from p0 to p1 with the x-axis
Compute the transform that moves point p0 to the origin and aligns the line from p0 to p1 with the x - axis