Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#26 2012-11-24 01:39:28

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,877

Re: Newton Fractal

Ah..........got it!

I had looked at the old posts again and tried to use a-z<0.000000001, but that didn't work although I thought it would. However, your ABS fixed it. smile

Thanks!

EDIT: I've altered the code I posted.

Last edited by phrontister (2012-11-24 01:50:59)


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#27 2012-11-24 01:52:10

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Newton Fractal

Hi;

Does it work better or does it still only get there for the interval you had?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#28 2012-11-24 02:02:45

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,877

Re: Newton Fractal

It's just as fast and gives exactly the same result as my original code, which is accurate to 15 digits only. I don't know how to get more digits than that in LB.

What do you mean by "interval"?

Last edited by phrontister (2012-11-24 02:04:06)


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#29 2012-11-24 02:14:31

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Newton Fractal

I wrote an LB program for it, and unless my initial guess is between 33.886745 and 39.999999, LB goes crosseyed.

Must you still enter between those two numbers?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#30 2012-11-24 02:58:58

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,877

Re: Newton Fractal

Hi Bobby,

Yes. If I enter >=40 or <=33.886744, LB gives a Runtime Error.

Btw, the interval isn't precise...it's truncated so it fits into the 'Prompt' window (see image) that opens when starting the program.

Last edited by phrontister (2012-11-24 03:05:10)


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#31 2012-11-24 03:05:08

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Newton Fractal

Hi;

SQR(1600-x^2)

This line is causing some of that.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#32 2012-11-24 03:16:52

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,877

Re: Newton Fractal

Do you mean both denominators in that line?

And what about the derivative line?

I might try my code on the polynomial that I posted in the other thread...but maybe the bogus roots might be an issue (just a thought).


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#33 2012-11-24 03:18:16

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,877

Re: Newton Fractal

No...I can't try it on the polynomial, because I don't know how to get the derivative.


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#34 2012-11-24 03:20:26

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Newton Fractal

Hi;

SQR(1600-x^2)

When x is greater than 40 then x^2 is greater than 1600. So when you subtract something bigger than 1600 from 1600 you get a negative number. LB does not know how to deal with the square root of a negative number.

SQR(1600-x^2)


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#35 2012-11-24 03:25:27

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,877

Re: Newton Fractal

Oh, of course. I don't know what to do about that, other than to give the polynomial a try.

That will have to wait until tomorrow, though. I'm off to bed now.

See you later, Bobby.


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#36 2012-11-24 03:38:34

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Newton Fractal

Hi;

Okay, see you tomorrow.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#37 2012-11-24 16:14:01

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,996
Website

Re: Newton Fractal

One question, Do any of you use the POV-Raytracer?


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#38 2012-11-24 16:15:40

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Newton Fractal

Hi Agnishom;

I am sorry, I do not?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#39 2012-11-24 16:19:03

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,996
Website

Re: Newton Fractal

Hmm...Okay..No Problem
I had been thinking to use it to generate Fractals


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#40 2012-11-24 16:21:31

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Newton Fractal

There are some nice fractal programs out there. I used to use fractint.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#41 2012-11-24 16:23:09

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,996
Website

Re: Newton Fractal

Is it free to download?


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#42 2012-11-24 16:24:22

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Newton Fractal

I believe it is or at least it used to be.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#43 2012-11-24 16:59:03

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,996
Website

Re: Newton Fractal

Let me see ... hmm


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#44 2012-11-24 17:05:13

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,996
Website

Re: Newton Fractal

This program is for DOS and I think I won't be able to run it properly


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#45 2012-11-24 17:13:22

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Newton Fractal


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#46 2012-11-25 00:15:44

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,996
Website

Re: Newton Fractal

Wow! these are nice
By the way, I tried hsfractal today morning, and found that it works on my 32bit machine


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#47 2012-11-25 00:29:33

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Newton Fractal

Hi;

Very good! Have fun with it.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#48 2012-11-25 00:44:58

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,996
Website

Re: Newton Fractal

Thanks for the links you provided

Among those, which one is your favorite and which is the second favorite?


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#49 2012-11-25 00:52:37

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Newton Fractal

Hi;

I am a little partial to the one that drew those pictures. They are amazing.
The HS fractal is the one I like the least. All the rest I think are  better but that is up to
you to decide.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#50 2012-11-25 00:56:31

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,877

Re: Newton Fractal

Hi Bobby,

phrontister wrote:
bobbym wrote:

I wrote an LB program for it, and unless my initial guess is between 33.886745 and 39.999999, LB goes crosseyed.

Must you still enter between those two numbers?

Yes. If I enter >=40 or <=33.886744, LB gives a Runtime Error.

This LB program on RosettaCode.org that finds the roots of a function is different from mine, and asks for a range for x (ie, separate minimum and maximum values).

For the polynomial function no upper and lower limits seem to be required, but the result is a couple of decimal places less accurate and it also finds a bogus root.

I found a derivative online (I didn't know how to do them) for the polynomial, but my LB program hangs for some reason. Debugging revealed a couple of things that I tried to iron out, but to no avail. I'll leave it there, though...I'm losing interest with this one.


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

Board footer

Powered by FluxBB