code: private static double getSideLengthFromCircumscribedRadius(double radius, int n) {
  		if (n == 2) {
  			return radius;
  		}
  		return radius * (2 * Math.sin(Math.PI/n));
  	}
docs: http://www.mathopenref.com/polygonradius.html