Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
3D graphic
#2
You are mixing pure python operations (float and lists) with vector-oriented ones using numpy. Although there is nothing wrong with this normally it is better to stick to one of them... in this cae I think the proper one is numpy, but is up to you.

Numerically your code has many small details that I think you shall take into account:
- Your f function has singularities around theta=-2*pi, 0, 2*pi... it will be good idea to either filter them or prpare your code to deal with inf and -inf.
- In your somme function (and later) you use if teta//(pi/2)==0 I imagine to exclude this singularities... but notice that that is true for teta in the range [0.0 to 1.57..] that I think is not really what you whant to exclude
- For the plot you are creating a mesh in the range of [-150, 150] and your i, j variable vary from 0 to 300. Then you call f(i, j, k) so at least for j you are using a range of values between 0 and 300 radians (~47 complete revolutions) so I think there there is a mixture of indexes, degrees and radians.
Reply


Messages In This Thread
3D graphic - by lollie - Jun-10-2018, 06:24 PM
RE: 3D graphic - by killerrex - Jun-10-2018, 10:05 PM
RE: 3D graphic - by lollie - Jun-11-2018, 07:21 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Matplolib graphic from batch achilledue 2 2,544 Sep-11-2019, 08:43 AM
Last Post: buran
  how can I create a recursive graphic with matplotlib royer14 3 3,760 Nov-22-2018, 05:00 PM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

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