Here you can find the source of fitsRotated(Rectangle2D o1, Rectangle2D o2)
public static boolean fitsRotated(Rectangle2D o1, Rectangle2D o2)
//package com.java2s; //License from project: Creative Commons License import java.awt.geom.Rectangle2D; public class Main { public static boolean fitsRotated(Rectangle2D o1, Rectangle2D o2) { return (o1.getHeight() <= o2.getWidth() && o1.getWidth() <= o2.getHeight()); }/* w w w . jav a 2 s.co m*/ }