Question
Coding: # This function paints a filled circle of radius R # and color NewColor on the Canvas, using as # the coordinates of the
Coding:
# This function paints a filled circle of radius R # and color NewColor on the Canvas, using as # the coordinates of the center of the circle. # Xc, Yc, and R are all allowed to be floats. #
def addCircleFilled (Canvas,Xc,Yc,R,NewColor=black): return
# This function paints a bunch of black lines radially around # where R1 and R2 are the inner and outer radii and # Segments indicates the number of lines. Xc, Yc, R1, and R2 # are all allowed to be floats. #
In the blank space in the addCircleFilled function (see above), write new code to paint a filled circle with the center of the circle at location with radius R and color NewColor. You must use the JES function addOvalFilled, which has the following formal parameters: addOvalFilled(picture, startX, startY, width, height, color) In this JES function, startX and startY are the coordinates of the upper-left corner of an oval (not a circle), and width and height describe the size of the ovals bounding box. We want to use those parameters to create a circle.
You must figure out how to convert the Xc, Yc, and R of our new addCircleFilled function into the startX, startY, width, and height that can be used to call the addOvalFilled function of JES. HINT: Remember that addOvalFilled requires integer parameters; but many of the values calculated in this program are passed to addCircleFilled as floats and must be rounded and converted to integers before they can be used in the call to addOvalFilled. You are allowed to type in and use the INT function.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started