Professional Documents
Culture Documents
while (n--)
{
DrawPoint( round(x), round(y) );
x += dxdt;
y += dydt;
}
}
• So which of the green pixels is next?
What’s bad about this?
1
Our Example Implicit Functions
• Normally, a line is defined as
y+3 • Instead, define , and let the line
be everywhere where
y+2 • Now, if , we’re “above” the line, and if
, we’re “below” the line
y+1
y
x x+1 x+2 x+3 x+4 x+5 x+6 x+7
If we’re going E:
SE
2
Drawing the 2nd Octant Final Circle Drawer
void Circle( int cx, int cy, int radius ) void Circle( int cx, int cy, int radius )
{ {
int x = 0, y = radius, e = 1-radius; int x = 0, y = radius, e = 1-radius;
int incrE = 3, incrSE = -2*radius + 5
DrawPoint( x + cx, y + cy );
• Look at all those DrawPoint( x + cx, y + cy );
3
The Koch Curve Properties of the Koch Curve
• Start with a line • It occupies a finite area in the plane
• Replace the line with four lines, and repeat: • It has infinite length
• It is self-similar
• It has a dimension of
4 2 2
• Blood vessel structure
• Ethernet packet traffic (okay, that’s not really Nature)
8 2 3
4 3 ?
#define ANGLE 45
void tree (float X1, float Y1, float R,
float Theta, int Level)
{
float SX, SY, EX, EY;
if (Level > 0)
{
EX = X1 + (R * cos(Theta));
EY = Y1 + (R * sin(Theta));
line (X1, Y1, EX, EY);
4
Better Fractal Trees Non Symmetric Tree
#define RT_ANGLE 45
#define LFT_ANGLE 65
if (Level > 0)
{
EX = X1 + (R * cos(Theta));
EY = Y1 + (R * sin(Theta));
5
Julia Set for C = .2+.6i Julia Set for C = .1+.6i