protected void createPoints ( ) { ArrayList tempPoints = new ArrayList ( ) ; maxX = - Float . MIN_VALUE ; maxY = - Float . MIN_VALUE ; minX = Float . MAX_VALUE ; minY = Float . MAX_VALUE ; float start = 0 ; float end = 359 ; float cx = x + radius1 ; float cy = y + radius2 ; int step = 360 / segmentCount ; for ( float a = start ; a <= end + step ; a += step ) { float ang = a ; if ( ang > end ) { ang = end ; } float newX = ( float ) ( cx + ( FastTrig . cos ( Math . toRadians ( ang ) ) * radius1 ) ) ; float newY = ( float ) ( cy + ( FastTrig . sin ( Math . toRadians ( ang ) ) * radius2 ) ) ; if ( newX > maxX ) { maxX = newX ; } if ( newY > maxY ) { maxY = newY ; } if ( newX < minX ) { minX = newX ; } if ( newY < minY ) { minY = newY ; } tempPoints . add ( new Float ( newX ) ) ; tempPoints . add ( new Float ( newY ) ) ; } points = new float [ tempPoints . size ( ) ] ; for ( int i = 0 ; i < points . length ; i ++ ) { points [ i ] = ( ( Float ) tempPoints . get ( i ) ) . floatValue ( ) ; } }
Generate the points to outline this ellipse .