Presentation is loading. Please wait.

Presentation is loading. Please wait.

Rendering Implicit Plots. What is an Implicit Plot? An implicit plot is a plot of all the points satisfying equation:  f(x,y) = 0 (for some function.

Similar presentations


Presentation on theme: "Rendering Implicit Plots. What is an Implicit Plot? An implicit plot is a plot of all the points satisfying equation:  f(x,y) = 0 (for some function."— Presentation transcript:

1 Rendering Implicit Plots

2 What is an Implicit Plot? An implicit plot is a plot of all the points satisfying equation:  f(x,y) = 0 (for some function f) The points plotted are connected by lines to form one or more curves.

3 Rendering an Implicit Plot Standard Approach Start with a grid of evenly spaced points and evaluate the function at each point on the grid.

4 Rendering an Implicit Plot Standard Approach Look at each square in the grid. If f has a different sign for two adjacent corners then somewhere in between it was 0. Linear Approximation can be used to estimate the point on the line where f(x,y) = 0

5 Linear Approximation Start with the two points (x 0,y 0 ), (x 1,y 1 ) where the sign change in f occurred We know that somewhere on the line between (x 0,y 0 ), (x 1,y 1 ) that the value of f is 0 The parametric equation of a line is defined as follows:  (x,y) = (x 0,y 0 )(1-t)+(x 1,y 1 )t What we do is use this equation to approximate f for values of x and y  f(x,y) = f(x 0,y 0 )(1-t)+f(x 1,y 1 )t Here we are only interested in finding where f(x,y) = 0  0 = f(x 0,y 0 )(1-t)+f(x 1,y 1 )t

6 Linear Approximation - Continued We are now able to solve 0 = f(x 0,y 0 )(1-t)+f(x 1,y 1 )t for t and plug the result back into (x,y) = (x 0,y 0 )(1-t)+(x 1,y 1 )t This results in the following point:

7 Problem with the standard approach If the grid isn't fine enough part of the curve might be missed. A simple but inefficient solution would be to just make the grid more finely grained.

8 Rendering Plots using an Adjustable Mesh The idea behind an adjustable mesh is to start with a reasonable grid and only increase the grid's resolution in areas where it's necessary.

9 Adjustable Mesh Starting with an initial grid the algorithm looks for areas where the function changes rapidly and increases the resolution in those areas.

10 Adjustable Mesh - Data Structure The data structure for the adjustable mesh is made up of two main components.  Edges 2 points that define the line segment References to the two faces holding the edge  Faces Composed of 3 edges:  Two edges sharing a common vertex  A hypotenuse that shares a vertex with each of the edges.

11 Determining how much the function changes Given three points and the value of the function at each point we can create 2 3D vectors and look at the angle between the vectors.

12 Adjustable Mesh To avoid tears in the plot sides shared by two regions must be the same.

13 Adjustable Mesh By adding a point in the middle of a square and dividing the square into 4 triangles. It is possible to increase the resolution without affecting adjacent squares.

14 Adjustable Mesh The grid can be further subdivided by adding the midpoint of the newly created square.

15 Existing Implementations This type of algorithm has been implemented in both:  Mathematica  Maple

16 Our Implementations We developed two implementations of the adjustable mesh algorithm. One in Java and the other in Sage.

17 Adjustable Mesh - Actual Performance

18 cos(x+y) - (xy) 2

19 Comparing Performance cos(x+y) - (xy) 2 X-Range: (-3,3) Y-Range: (-3,3)  Adjustable Mesh: 5.23 seconds  Standard Algorithm: 2.08 seconds X-Range: (-10,10) Y-Range: (-10,10)  Adjustable Mesh: 8.78 seconds  Standard Algorithm: 21.48 seconds


Download ppt "Rendering Implicit Plots. What is an Implicit Plot? An implicit plot is a plot of all the points satisfying equation:  f(x,y) = 0 (for some function."

Similar presentations


Ads by Google