ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 15 Dec 2011 06:37:20 -0600Newton's cubic Fractal help. Plotting https://ask.sagemath.org/question/8555/newtons-cubic-fractal-help-plotting/I'm solving newton's cubic for all the black points that occur within the fractal:
I have the code:
LA(x) = x - (x^3.0-1)/(3.0*x^2.0)
S = solve(LA==0,x)
for s in S:
solve(LA == s.rhs(),x)
and i want to take all those points I'm generating and plot them in a scatter plot. I think I have to use an array? Can anyone tell me exactly how I tell sage to put these points in an array then plot them? Thanks everyone for your help
----------
Wed, 14 Dec 2011 14:44:19 -0600https://ask.sagemath.org/question/8555/newtons-cubic-fractal-help-plotting/Answer by Shashank for <p>I'm solving newton's cubic for all the black points that occur within the fractal:</p>
<p>I have the code:</p>
<p>LA(x) = x - (x^3.0-1)/(3.0*x^2.0)
S = solve(LA==0,x)
for s in S:
solve(LA == s.rhs(),x)</p>
<p>and i want to take all those points I'm generating and plot them in a scatter plot. I think I have to use an array? Can anyone tell me exactly how I tell sage to put these points in an array then plot them? Thanks everyone for your help</p>
<hr/>
https://ask.sagemath.org/question/8555/newtons-cubic-fractal-help-plotting/?answer=13018#post-id-13018 LA(x) = x - (x^3.0-1.0)/(3.0*x^2.0)
S = solve(LA==0,x)
n=0
for s in S:
a=solve(LA == s.rhs(),x)
n=n+1
point([a[i].rhs().n().real(),a[i].rhs().n().imag()] for i in range(n))
Does this help?Thu, 15 Dec 2011 06:37:20 -0600https://ask.sagemath.org/question/8555/newtons-cubic-fractal-help-plotting/?answer=13018#post-id-13018