Math Is Fun Forum

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

You are not logged in.

#1 2009-10-02 13:13:58

MathsIsFun
Administrator
Registered: 2005-01-21
Posts: 7,711

Implicit Equation Grapher

Continuing on with my current "equations and functions" obsession, I have made an Implicit Equation Grapher

It basically calculates each pixel and tries to find 0. It has trouble with missing parts of the domain, for example tan() goes from "negative large number" to "positive large number" so assumes it is 0 in between and I am not sure how to convince it otherwise (without heaps of code and very slow response).

It is nonetheless heaps of fun seeing the different things it can do.

Play with it and let me know how you go.

Post interesting equations, too.


"The physicists defer only to mathematicians, and the mathematicians defer only to God ..."  - Leon M. Lederman

Offline

#2 2009-10-03 00:46:56

mathsyperson
Moderator
Registered: 2005-06-22
Posts: 4,900

Re: Implicit Equation Grapher

Fun toy! My favourite one that I've found so far is sin(5x) = cos(5x).


Why did the vector cross the road?
It wanted to be normal.

Offline

#3 2009-10-03 01:01:45

JaneFairfax
Member
Registered: 2007-02-23
Posts: 6,868

Re: Implicit Equation Grapher

Cool! That’s just what I need. up

Offline

#4 2009-10-03 01:21:11

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

Re: Implicit Equation Grapher

Hi MathsisFun;

Nice grapher!

Playing with this one.

Last edited by bobbym (2009-10-03 01:21:35)


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

#5 2009-10-03 02:51:10

simron
Real Member
Registered: 2006-10-07
Posts: 237

Re: Implicit Equation Grapher

This is really great!
I like sin(x)=tan(y).


Linux FTW

Offline

#6 2009-10-03 03:04:27

mathsyperson
Moderator
Registered: 2005-06-22
Posts: 4,900

Re: Implicit Equation Grapher

Haha, bobbym's is crazy.


Why did the vector cross the road?
It wanted to be normal.

Offline

#7 2009-10-03 05:40:17

JaneFairfax
Member
Registered: 2007-02-23
Posts: 6,868

Re: Implicit Equation Grapher

Try this.

y=abs(x)*tan(3*sqrt(x^2+y^2))

It’s actually an Archimedean spiral superimposed on its reflection in the y-axis (recall that an Archimedean spiral has the form r = in polar coordinates). To fit more turns into the picture, try y=abs(x)*tan(4*sqrt(x^2+y^2)), y=abs(x)*tan(5*sqrt(x^2+y^2)), etc.

Offline

#8 2009-10-03 12:47:33

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

Re: Implicit Equation Grapher

Hi MathsisFun;

Seems to be okay, haven't been able to crash it.

Like this one:

Last edited by bobbym (2009-10-03 12:49:03)


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

#9 2009-10-03 13:14:20

MathsIsFun
Administrator
Registered: 2005-01-21
Posts: 7,711

Re: Implicit Equation Grapher

I am so glad everyone likes it!

Some really wild equations, too

An example of where it goes wrong is bobby's "x^2*cos(x)=y*tan(y)" ... I don't believe the horizontal straight lines should be there at +/-π/2, they are an artifact of tan(y) changing sign, so the program assumes there is a zero in there.

The program has no way of knowing that the magical zero point is undefined. Any ideas on how to solve this?

A simpler example is "1/(1+x)=y"


"The physicists defer only to mathematicians, and the mathematicians defer only to God ..."  - Leon M. Lederman

Offline

#10 2009-10-03 14:29:40

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

Re: Implicit Equation Grapher

Hi Maths;

Is it the vertical asymptote you don't like for 1 / ( 1 + x ) = y ?


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

#11 2009-10-03 15:31:11

MathsIsFun
Administrator
Registered: 2005-01-21
Posts: 7,711

Re: Implicit Equation Grapher

bobbym wrote:

Is it the vertical asymptote you don't like for 1 / ( 1 + x ) = y ?

Correct.

I have been able to "suppress" lines like that by skipping over values above, say 100, but that may also miss valid points.


"The physicists defer only to mathematicians, and the mathematicians defer only to God ..."  - Leon M. Lederman

Offline

#12 2009-10-03 17:22:33

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

Re: Implicit Equation Grapher

Hi MathsisFun;

If you go here:

http://www.wolframalpha.com/

And enter in the top box, just as it is written below:

Plot[1/(x+1),{x,-5,5}]

You will see that yours is fine. At least for this graph.

Last edited by bobbym (2009-10-03 17:25:03)


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

#13 2009-10-04 12:07:48

MathsIsFun
Administrator
Registered: 2005-01-21
Posts: 7,711

Re: Implicit Equation Grapher

Thanks bobby,

That gives me some courage. So perhaps Wolfram and I can simply put it down to an ill-defined domain.

I am still not happy, but I have tried different techniques and they all have side effects.

I will put some warning on the page to cover it.


"The physicists defer only to mathematicians, and the mathematicians defer only to God ..."  - Leon M. Lederman

Offline

#14 2009-10-04 21:51:29

MathsIsFun
Administrator
Registered: 2005-01-21
Posts: 7,711

Re: Implicit Equation Grapher

I have given it ZOOM capabilities.

You should see cos(x)+sin(x*y)=cos(y*x)+sin(y) , but that is hard on the poor program!

I also mentioned about the "extra lines" ... does it seem a reasonable explanation?


"The physicists defer only to mathematicians, and the mathematicians defer only to God ..."  - Leon M. Lederman

Offline

#15 2009-10-05 10:35:30

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

Re: Implicit Equation Grapher

MathsisFun;

Graphing is always a problem. You can only sample a finite amount of points. There are equations that look different with different scales even in math packages and graphic calculators.


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

#16 2009-10-05 11:14:07

simron
Real Member
Registered: 2006-10-07
Posts: 237

Re: Implicit Equation Grapher

One thing I'd like to see is recognizing that xy is the same thing as x*y.
Another one I like is tan(x*y)=sin(x)+cos(y).


Linux FTW

Offline

#17 2009-10-05 12:34:09

MathsIsFun
Administrator
Registered: 2005-01-21
Posts: 7,711

Re: Implicit Equation Grapher

simron wrote:

One thing I'd like to see is recognizing that xy is the same thing as x*y

That is a good idea, possibly hard, but I will look into it.


"The physicists defer only to mathematicians, and the mathematicians defer only to God ..."  - Leon M. Lederman

Offline

#18 2009-10-05 22:53:51

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

Re: Implicit Equation Grapher

Hi all;

Working fine:


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

#19 2009-10-05 23:29:04

JaneFairfax
Member
Registered: 2007-02-23
Posts: 6,868

Re: Implicit Equation Grapher

bobbym wrote:


Try
. wink

Last edited by JaneFairfax (2009-10-06 09:39:33)

Offline

#20 2009-10-06 00:35:19

MathsIsFun
Administrator
Registered: 2005-01-21
Posts: 7,711

Re: Implicit Equation Grapher

Whoa, that would make a good logo.

BTW, I have called it an "Implicit Equation Grapher", but maybe it should just be "Equation Grapher" ... ?

Or something else?


"The physicists defer only to mathematicians, and the mathematicians defer only to God ..."  - Leon M. Lederman

Offline

#21 2009-10-06 03:09:34

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

Re: Implicit Equation Grapher

Hi Jane;

Jane wrote:

That's a nice one. It looks meaner than mine.


Hi MathsisFun;

Since it can graph explicit forms, I guess you can call it "The Grapher" or "The Plotter".

We can make a small improvement on Jane's improvement.

Last edited by bobbym (2009-10-06 04:14:47)


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

#22 2009-10-06 09:40:18

JaneFairfax
Member
Registered: 2007-02-23
Posts: 6,868

Re: Implicit Equation Grapher


Or
.

Last edited by JaneFairfax (2009-10-06 09:41:57)

Offline

#23 2009-10-06 12:49:54

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

Re: Implicit Equation Grapher

Hi Jane;

Or this one:

I especially like the feathered effect at the corners.


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

#24 2009-10-07 16:56:02

MathsIsFun
Administrator
Registered: 2005-01-21
Posts: 7,711

Re: Implicit Equation Grapher

Love them!

I added a Print button.


"The physicists defer only to mathematicians, and the mathematicians defer only to God ..."  - Leon M. Lederman

Offline

#25 2009-10-07 19:39:52

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

Re: Implicit Equation Grapher

Hi MathsisFun;

Do you think it would be possible to save the graph in some format like jpeg or gif so that the graph could be used in a post ?


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

Board footer

Powered by FluxBB