Here you can find the source of intersection(Area a1, Area a2)
Parameter | Description |
---|---|
a1 | some area |
a2 | some other area |
public static boolean intersection(Area a1, Area a2)
//package com.java2s; // GNU Affero General Public License as published by the Free Software Foundation, either version import java.awt.geom.Area; public class Main { /**// ww w . j a va 2 s . co m * Check whether the two provided areas intersect one another. * * @param a1 some area * @param a2 some other area * @return true if there is a non-empty intersection */ public static boolean intersection(Area a1, Area a2) { Area copy = new Area(a1); copy.intersect(a2); return !copy.isEmpty(); } }