cos( 0 * PI) = cos(0) = 1
so you are setting rxc to to the x-radius instead of 0 if you have corner "center"