![]() |
Anaconda programme - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Homework (https://python-forum.io/forum-9.html) +--- Thread: Anaconda programme (/thread-28505.html) |
Anaconda programme - Sbottaro - Jul-21-2020 Hi everyone I have two exercises to do but it's my first time using Python so I found lot of problems... Does anyone can help me? The exercises are these two: 1)Write a programme which read by input the valor (in degrees) of an angle and which can calculate the valor of the function: cos^2(x)*sin(90°-x)+ 1/2. 2) Prepare a figure with 4 pannels place as a matrix 2x2. Each of these pannel has an axis of the abscissa x which explore the interval [-6pi : 6pi]. Report the functions cos(x), sin(x), cos(x)*exp(-x/8), sin(x)*exp(-x/8), one for each pannel. Use a blue line for the first two and a dashed blue line for the last two. Thanks everyone for your help ![]() ![]() ![]() ![]() ![]() ![]() RE: Anaconda programme - jefsummers - Jul-22-2020 Show us your work. We arent going to do your homework for you, but if you show us what you have done and where you are stuck we can help RE: Anaconda programme - Sbottaro - Jul-22-2020 (Jul-22-2020, 01:58 AM)jefsummers Wrote: Show us your work. We arent going to do your homework for you, but if you show us what you have done and where you are stuck we can helpHi thanks a lot for tour attention, I di the First exercise in this way: import math def calculate_angle(degree): angle=int(degree)* 2 * math.pi/360.0 return (math.pow(Mary.cos(angle),2)*math.sin(90-angle))+(1/2) degree= input('insert degree:') print(calculate_angle(degree))The programm works so i think it's correct. For the second exercise I don't know how to prepare a figure with 4 pannels placed as a Matrix 2x2 RE: Anaconda programme - jefsummers - Jul-22-2020 Exactly how you do that depends on what plotting libraries you have been taught, and what graphical interface. Matplotlib is common. You need to be able to create the 4 panels each with a plot. Are you using Flask to use a web interface, or a GUI such as Wx or Tkinter? And, curious, you have Anaconda as your subject line which is a platform but not an IDE. Are you then using Spyder, Jupyter Lab, or VSC? RE: Anaconda programme - Sbottaro - Jul-23-2020 (Jul-22-2020, 06:07 PM)jefsummers Wrote: Exactly how you do that depends on what plotting libraries you have been taught, and what graphical interface. Matplotlib is common. You need to be able to create the 4 panels each with a plot. Are you using Flask to use a web interface, or a GUI such as Wx or Tkinter? And, curious, you have Anaconda as your subject line which is a platform but not an IDE. Are you then using Spyder, Jupyter Lab, or VSC?I use spyder. Thanks for tour help I manager to do the pannels with the module matplotlib |