Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Anaconda programme
#1
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 Heart Heart Heart Heart Heart Heart
Reply
#2
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
Reply
#3
(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 help
Hi 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
Reply
#4
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?
Reply
#5
(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
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020