#Graphing implicit equations

43 messages · Page 1 of 1 (latest)

reef briar
#

I'm making a graphing calculator with JavaScript and I'm able to graph simple functions in the form y=f(x). However, I can't figure out how I'd graph implicit equations(eg. y^2+x^3=3x+3x^2-2). I figure you can get a bunch of points belonging to the function by iterating over values of y and solving for x using root estimation methods, but I have no good way of figuring out how to connect the points. Are there any good ways to do this?

#

Graphing implicit equations

remote monolith
reef briar
#

The thing is I'm dealing with pixels

#

And that means you can't have infinite precision

#

You have to include pixels that technically aren't part of the graph to make the whole thing continuous

#

Consider a•sin(x), where a is some large number

remote monolith
reef briar
#

Yea

#

So I have to connect the points together

#

If not I could just get a bunch of disconnected points

reef briar
remote monolith
#

Yes

#

plotting a function also misses points on the x axis

reef briar
#

Which does the job quite well

#

Added bonus of no nested for loops

#

For implicits I'm a bit stumped though

#

An example of what would happen in some cases if we're iterated over every pixel, but didn't connect the points, with some vertical line

reef briar
#

@weary rover very goated conversation

#

What do you think I could do

reef briar
reef briar
#

@pulsar flame would I be able to graph a line segment of length √2 on a screen

reef briar
reef briar
reef briar
pulsar flame
# reef briar How would I graph implicit equations on a screen

The Constructivist Perspective: Pixels

A constructivist wants every step in the graphing process to be given by a finite, explicit procedure. This means you need:

• An algorithmm that takes as input an implicit equation (for example, F(x, y) = 0) and a finite region of the plane to examine.

• Finite resolution “pixels” or intervals, aannd

• A method to decide - using an algorithm - that a piece of the graph exists in each pixel with controlled error.

In other words, you want to “construct” the graph by showing, in each finite subinterval, how the function behaves.

reef briar
#

So yea im using interval bisection

#

Then iterating over y for the range of values of y to solve for x such that F(x,y)=0

#

So that gives me a bunch of coordinates

reef briar
#

For functions I just estimated by drawing vertical lines to connect the pixels to those beside it

#

But with implicit equations I don't know how I'd link them

pulsar flame
reef briar
#

It's not that deep 😭

#

I just want to know how to connect these points

reef briar