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

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