java - Draw random circles, coloring in red any circle not intersecting another circle -
i have java swing assignment following objectives: when program starts, draws 20 unfilled circles, radius , location of each determined @ random. if perimeter line of circle not intersect other circle, draw outline of circle in red. if intersect @ least 1 other circle, draw in black. add jbutton that, each time pressed, creates new set of circles described above. i've completed objectives #1 , #3 above, i'm stumped on objective #2. before present code, let me give understanding of math behind it. there 2 ways circle can not intersect circle: the circles far apart share perimeter point, i.e. distance between centers greater sum of radii (d > r1 + r2). example . one circle inside circle, , perimeters not touch, i.e. distance between centers less difference between radii (d < |r1 - r2|). example . what i've got far: to compare circles, must specified before drawn, used for-loop store 20 values in arrays center coordinates (int[] x, int[] y) , radi...