Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

# This function paints ONE anime eyeball on the Canvas, centered at <Xc,Yc>. The

ID: 3605799 • Letter: #

Question

# This function paints ONE anime eyeball on the Canvas, centered at <Xc,Yc>. The color of the iris is NewColor, the pupil is black, and the highlights are white. The sizes and positions of the iris, pupil, starburst, and highlights are derived from center point <Xc,Yc> and the radius R of the iris. #

def Eyeball (Canvas,Xc,Yc,R,NewColor):

return

In the Eyeball function (see above), write new code to paint a single anime eyeball on the canvas, given the center of the circle is at location <Xc, Yc>, with iris radius R and iris color NewColor (all of this is passed in through the parameter list). In Eyeball, you will need to call the addCircleFilled function four times, once for the iris, once for the pupil, and once for each of the two highlights.

The radius of the iris (the colored area) comes directly from parameter R. The radius of the pupil (the black center of the eye) is half the radius of the iris, and has the same center coordinates as the iris. The radius of the big highlight (the big white spot) is one-quarter that of the iris. The radius of the smaller highlight is one-seventh that of the iris. The centers of the highlights are located relative to the center of the eyeball at a distance offset in the X and Y directions by an amount calculated as follows: Offset = 1/4 R sq rt

This will put the center of the highlights directly on the boundary between the pupil and the iris, at 45 degree angles relative to the center of the pupil. You will also have to call addStarburst at the appropriate time. The starburst has the same center coordinates as the pupil and the iris. The inner radius is ½R (the radius of the pupil) plus 1 15 TH of R, and the outer radius is R minus 1 15th of R. There are 40 segments in the starburst.

Explanation / Answer

Please check the code

return

#