0

I'm writing a program that has 2 equations and when the first equation x, becomes equal to 0, I want to graph the original points (which i have set as p and q) picked. My code looks like this:

m = Matrix(200,200)
n = 0

for x in range (0,200):
    for y in range (0,200):
        p=x
        q=y
        c=0
        while (x > 0 and y > 0):
          i=x-y+100
          y=x+y-100
          c=c+1
          x=i
          if c > 1000:
              break
    if x < 0:
        plot(m(p,q), color='blue')

The only thing this does is show multiple graphs with a straight line at y=200 and y=-299 (or something like that) and I don't know why or how to fix it

I would post an image of the graph but I need higher reputation

hivert
  • 10,579
  • 3
  • 31
  • 56
awaitkus
  • 3
  • 1
  • 3
  • This code doesn't seem to work "as is", at least not in Sage. There are redundant things like `n` as well. I'm also not sure what you want to do - are you trying to actually plot a matrix? As to your plot - well, that's what you are computing: http://sagecell.sagemath.org/?q=fbfspe – kcrisman Apr 08 '14 at 01:06
  • @kcrisman thank you!! that was so nice of you. it wasn't quite what i need it to do but it was awesome. what it's supposed to do is graph all the points where x=0 before y hits 0. i know it is supposed to look like a spiral towards the center of the graph – awaitkus Apr 08 '14 at 15:29

0 Answers0