Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

Task3- Bouncing Ball- [20pts] It is time to do a bit of (simple) physics with a bouncing ball. The following is the console interaction if we execute...

Hi, I am having trouble with this part of my project. A lesson would be so great, and I hope someone can actually get to my question and reply, because it seems as though nobody does here. I have the mapping_for_tkinter file done already, and will paste it here, because you need to import it into the bouncing_ball.py file.

""" Enter your name(s) here"""from tkinter import * : , xmin, xmax, ymin, ymax, width):.__xmin = xmin.__xmax = xmax.__ymin = ymin.__ymax = ymax.__width = width.__height = width * ((ymax - ymin) / (xmax - xmin)) , xmin):.__xmin = xmin.__set_height() , xmax):.__xmax = xmax.__set_height() , ymin):.__ymin = ymin.__set_height() , ymax):.__ymax = ymax.__set_height() , width):.__width = width.__set_height() ): .__height = .__width * ((.__ymax - .__ymin) / (.__xmax - .__xmin)) ): .__xmin ): .__xmax ): .__ymin ): .__ymax ): .__width ): .__height FIX SCALE CONVERSION , i): ((float(i) / (.__width - )) * (.__xmax - .__xmin)) + .__xmin , y): ((float(y) / (.__height - )) * (.__ymax - .__ymin)) + .__ymin , x): ((float(x - .__xmin) / (.__xmax - .__xmin)) * (.__width - )) , y): ((float(y - .__ymin) / (.__ymax - .__ymin)) * (.__width - )) ): (str(.__xmin) + + str(.__xmax) + + str(.__ymin) + +str(.__ymax) + + str(.__width) + + str(.__height)) :m = Mapping_for_Tkinter(-, , -, , ) print(m) window = Tk() canvas = Canvas(window, width=m.get_width(), height=m.get_height(), bg=) canvas.pack()print()canvas.create_rectangle(, , , , outline=)print()canvas.create_oval(m.get_i(-), m.get_j(-), m.get_i(), m.get_j(), outline=)print() i range(m.get_width()):x = m.get_x(i) y = xcanvas.create_rectangle((m.get_i(x), m.get_j(y)) * , outline=)window.mainloop() __name_ == :main()
  • Attachment 1
  • Attachment 2
Task3- Bouncing Ball- [20pts]It is time to do a bit of (simple) physics with a bouncing ball. The following is theconsole interaction if we execute the application bouncing_ball . py (with defaultvalues- just clicking enter):Enter xmin, xmax, ymin, ymax (return for default -300,300, -300, 300):Enter x0, y0, v, theta (return for default 0, 0, 70,30):Total number of rebounds is: 24The last statement is printed after 15s of simulation time once the animation of thebouncing ball is done (using a while loop that breaks when t_total = 150).Two examples video of the bouncing balls are included in this project: bb1 .mp4 that usesthe default values (see below for a screen shot),Figure 5: bouncing_ball.py with defaults.and bb2.mp4 which is associated with this console interaction:Enter xmin, xmax, ymin, ymax (return for default -300,300,-300,300): -400 400 -40 40Enter x0, y0, v, theta (return for default 0, 0, 70,30): @ @ 80 60Total number of rebounds is: 133What you need to implement:1. You will complete the bouncing_ball . py file. You will be using an instance ofthe Mapping_for_Tkinter class defined in task1.2. The ball itself is a filled blue circle of radius 4. The center of the ball is taken as
Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question