question: public static Coordinate [ ] createSineStar ( double basex , double basey , double size , double armLen , int nArms , int nPts ) { double armBaseLen = size / 2 - armLen ; if ( armBaseLen < 0 ) armBaseLen = 0.5 ; double angInc = 2 * Math . PI / nArms ; int nArmPt = nPts / nArms ; if ( nArmPt < 5 ) nArmPt = 5 ; int nPts2 = nArmPt * nArms ; Coordinate [ ] pts = new Coordinate [ nPts2 + 1 ] ; int iPt = 0 ; double starAng = 0.0 ; for ( int iArm = 0 ; iArm < nArms ; iArm ++ ) { for ( int iArmPt = 0 ; iArmPt < nArmPt ; iArmPt ++ ) { double ang = iArmPt * ( 2 * Math . PI / nArmPt ) ; double len = armLen * ( 1 - Math . cos ( ang ) / 2 ) + armBaseLen ; double x = len * Math . cos ( starAng + iArmPt * angInc / nArmPt ) + basex ; double y = len * Math . sin ( starAng + iArmPt * angInc / nArmPt ) + basey ; Coordinate pt = new Coordinate ( x , y ) ; pts [ iPt ++ ] = pt ; } starAng += angInc ; } pts [ iPt ] = pts [ 0 ] ; return pts ; }
target:  Creates a star from a "circular" sine wave