0% found this document useful (0 votes)
25 views10 pages

Fractal Curve Generation Techniques

The document discusses different techniques for curve generation including parametric and non-parametric curves. It describes the DDA algorithm for circular arc generation and properties of Bezier and B-spline curves. It also provides an overview of fractals including their uses and examples.

Uploaded by

gauravrokade762
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views10 pages

Fractal Curve Generation Techniques

The document discusses different techniques for curve generation including parametric and non-parametric curves. It describes the DDA algorithm for circular arc generation and properties of Bezier and B-spline curves. It also provides an overview of fractals including their uses and examples.

Uploaded by

gauravrokade762
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Unit-II

Curves and Fractals

 Curve Generation:-
Many real world object are neither perfectly flat nor smoothly curved but often have
rough, jagged contours. For drawing these things we can use two approaches to
draw curved lines
a) One approach is to use a curve generation algorithm such as DDA.
b) Second approach the curve is approximated by a number of small straight line
segments.

Circular Arc Generation Using DDA Algorithm:


 The equation for an arc in the angle parameter can be given as
x=Rcosɵ +x0
y=Rsinɵ +y0 --------------------------------- (1)
 Where, (x0, y0 ) is the center of curvature , & R is the radius of arc.

 Differentiating equation (1) we get,


dx= - Rsinɵ dɵ
dy= Rcosɵ dɵ -------------------- (2)
 From equation (1) we can solve for Rcosɵ & Rsinɵ as follows
x=Rcosɵ +x0
i.e. Rcosɵ = x- x0 And
y=Rsinɵ +y0
i.e. Rsinɵ=y- y0 -------------------------------- (3)
 Substituting valued of R cosɵ & Rsinɵ from equation (3) in equation (2) we
get.
dx= - (y- y0 ) dɵ And
dy= (x- x0 ) dɵ ---------------------------- (4)
 The values of dx & dy indicate in x & y increment respectively, to be added in
the current point on the arc . Therefore we can write,
x2 = x1 +dx = x1 -( y1 – y0 ) dɵ
y2 = y1 +dy = y1 +( x2 – x0 ) dɵ ----------------------- (5)
 From equation (5) we can see the next point on the arc is the function of dɵ. To
have smooth curve the neighboring points on the arc should be close to each
other.
 To achieve this, the value of dɵ should be small enough not to leave gaps in the
arc. Usually, the value of dɵ can be determined from the equation .
dɵ= Min (0.01,1/(3.2*( | x- x0 | + | y- y0 | )))

Algorithm:
1. Read the center of a curvature , say (x0 , y0 )
2. Read the angle , say ɵ
3. Read the starting point of the arc , say (x,y)
4. Calculate dɵ
dɵ= Min (0.01,1/(3.2*( | x- x0 | + | y- y0 | )))
5. Initialize Angle = 0
6. While (Angle < ɵ)
do
{ plot (x,y)
x = x - ( y – y0 ) * dɵ
y = y + ( x – x0 ) * dɵ
Angle = Angle + dɵ
}
7. Stop

Problems in True-Curve Generation Approach:-


a) To specify a curve, we need more information than just its endpoints.
b) It is difficult to apply transformation.
c) New clipping algorithm is required to clip arcs.
d) The curve generation algorithm for curves other than circular or elliptical such as
airplane wings or cars or human faces etc.

 Representation of Parametric & Non-Parametric Curves:-


Parametric Curves :
A parametric surface is defined by equations that generate
vertex coordinates as a function of one or more free variables.
Non-Parametric Curves :
Nonparametric curve which is simply defined as a specific
set of vertices which are generally connected with straight lines.

 Spline Representation :
 To produce a smooth through a designed set of points, a flexible strip called spline
is used.
 Such a spline curve can be mathematically described with a piecewise cubic
polynomial function whose first & second derivatives are continuous across the
various curve section.
 We can , specify a spline curve by giving a set of coordinates position, called
control points, which indicates the general shape of the curve.
 When polynomial sections are fitted so that the curve passes through all control
points as shown in fig (a) , the resulting curve is said to interpolate the set of control
points.
 On the other hand, when the polynomial are fitted to the path which is not
necessarily passing through all control points, the resulting curve is said to
approximation the set of control points as shown in fig (b).

 Spline Specification:
There are three basic ways of specification spline curve:
I. We can state the set of boundary condition that are imposed on the spline.
II. We can state the matrix that characteristics the spline.
III. We can state set of blending function that calculate the positions along the curve
path by specifying combination of geometric constraints on the curve.
• Advantage: Smooth with just a few control point
• Disadvantage: Can be hard to control
• Uses:
a) Representation Of Smooth Shapes. Either As Outlines In 2D Or With
Patches Or Subdivision Surfaces In 3D
b) Animation Paths

 Parametric Representation of Circle & Ellipse:-

 Parametric Representation of Circle:-


 A circle can be defined as the locus of all points that satisfy the equations
x = r cos(t) y = r sin(t)
 where x,y are the coordinates of any point on the circle,
a) r is the radius of the circle and
b) t is the parameter - the angle subtended by the point at the circle's center.

 Parametric Representation of Ellipse:-


An ellipse can be defined as the locus of all points that satisfy the equations
x = a cos t y = b sin t
where:
a) x,y are the coordinates of any point on the ellipse,
b) a, b are the radius on the x and y axes respectively,
c) t is the parameter, which ranges from 0 to 2π radians.

 Bezier curves:-
 Bezier curve is discovered by the French engineer Pierre Bezier. These curves
can be generated under the control of other points.
 Approximate tangents by using control points are used to generate curve.
 The Bezier curve can be represented mathematically as –

Where pi is the set of points and Bin(t) represents the Bernstein polynomials which
are given by −

Where n is the polynomial degree, i is the index, and t is the variable.


 The simplest Bézier curve is the straight line from the point P0 to P1. A
quadratic Bezier curve is determined by three control points. A cubic Bezier
curve is determined by four control points.

 Properties of Bezier Curves:

a) They generally follow the shape of the control polygon, which consists of the
segments joining the control points.
b) They always pass through the first and last control points.
c) They are contained in the convex hull of their defining control points.
d) The degree of the polynomial defining the curve segment is one less that the
number of defining polygon point. Therefore, for 4 control points, the degree of
the polynomial is 3, i.e. cubic polynomial.
e) No straight line intersects a Bezier curve more times than it intersects its control
polygon.
f) They are invariant under an affine transformation.
g) Bezier curves exhibit global control means moving a control point alters the
shape of the whole curve.
h) A given Bezier curve can be subdivided at a point t=t0 into two Bezier segments
which join together at the point corresponding to the parameter value t=t0.

B-Spline curves:-

The Bezier-curve produced by the Bernstein basis function has limited flexibility.
 First, the number of specified polygon vertices fixes the order of the resulting
polynomial which defines the curve.
 The second limiting characteristic is that the value of the blending function is
nonzero for all parameter values over the entire curve.
The B-spline basis contains the Bernstein basis as the special case. The B-spline basis
is non-global.
 B-spline curve is defined as a linear combination of control points Pi and B-
spline basis function Ni, k (t) given by

Where,
 {pi: i=0, 1, 2….n} are the control points
 k is the order of the polynomial segments of the B-spline curve. Order k means that
the curve is made up of piecewise polynomial segments of degree k - 1,
 the Ni,k(t) are the “normalized B-spline blending functions”. They are described by
the order k and by a non-decreasing sequence of real numbers normally called the
“knot sequence”.

The Ni, k functions are described as follows –

and if k > 1,

And t€ (tk-1 , tn+1 )

 Properties of B-spline Curve:-

a) The sum of the B-spline basis functions for any parameter value is 1.
b) Each basis function is positive or zero for all parameter values.
c) Each basis function has precisely one maximum value, except for k=1.
d) The maximum order of the curve is equal to the number of vertices of defining
polygon.
e) The degree of B-spline polynomial is independent on the number of vertices of
defining polygon.
f) B-spline allows the local control over the curve surface because each vertex
affects the shape of a curve only over a range of parameter values where its
associated basis function is nonzero.
g) The curve exhibits the variation diminishing property.
h) The curve generally follows the shape of defining polygon.
i) Any affine transformation can be applied to the curve by applying it to the
vertices of defining polygon.
j) The curve line within the convex hull of its defining polygon.

 Fractals:-
To draw a Mountain, Trees, rivers, clouds we use rough, jagged & random surfaces.
Such surfaces are called as Fractals.
Examples of Fractals: Clouds, Grass, Fire, Modeling Mountains, Coastline,
Branches of a tree etc.
 Fractals are used in many areas such as −
1. Astronomy − For analyzing galaxies, rings of Saturn, etc.
2. Biology/Chemistry − For depicting bacteria cultures, Chemical reactions, human
anatomy, molecules, plants,
3. Others − For depicting clouds, coastline and borderlines, data compression,
diffusion, economy, fractal art, fractal music, landscapes, special effect, etc.

 Classification of fractals:-
Fractals can be classified according to their self similarity. There are three parts
of self similarity found in fractals:
a) Self Similar Fractals:-
 These fractals have parts that are scaled down versions of the entire object.
 We construct the object subparts by applying a scaling parameter’s to the
overall shape.
 We can use same scaling or different scaling factor s for all subparts. This
fractal is used to model trees, clouds & terrain.
b) Self Affine:-
 Formed with different scaling parameters sx, sy, sz in different coordinates
direction.
 This fractal used to model Terrain, Water, clouds etc.
c) Invariant Fractal Sets :-
 This class of fractals included self squaring fractals such as Mandelbrot set,
which are formed with squaring function in complex space, & self inverse
fractals, from with inversion procedure.

 Topological Dimension:-
 Consider an object composed of elastic or clay.
 If the object deformed into a line or line segment we assign its dimension Dt = 1.
 If object deforms into a plane or half disk we assign its dimension Dt = 2.
 If object deforms into all space or half space or sphere we assign its dimension
Dt = 3.
 The dimension Dt is referred to as the Topological Dimension.

 Fractal Dimension:-
 Imagine that a line segment of length L is divided into N identical pieces. The
length of each line segment I can be given as l=L/N
 The ratio of length of original line segment & the length of each part of the line
segment is referred to as scaling factor & is given as. S=L/l

From above two equation we can write N=s i.e. N=s1
In other words we can say that if we scale a line segment a line segment by a
factor 1/s then we have to add N pieces together to get the original line
segment. If we scale square by a factor 1/s we will get a small square In case of
s=2 we require 4 pieces of square to get original square. In general we can write
N=s2 Similarly for cubical object we have N=s3
 We have seen that we can specify the dimension of the object by a variable D.
Here the exponent of s is a measure of object dimension. Thus we can write,
N=s D .
Solving for D we get D=log N/log s This D is called Fractal Dimension.

 Hilbert’s curves:-
 The Hilbert’s curves can be constructed by following successive approximations. If
a square is divided into four quadrants we can draw the first approximation to the
Hilbert’s curves by connecting center point of each quadrant.
 The second approximation to the Hilbert’s curves can be drawn by further
subdividing each of the quadrants & connecting their centers before moving to next
major quadrant.
 The third approximation subdivides the quadrants again. Connecting their centers of
finest level of quadrant before stepping to the next level of the quadrant.

First Approximation Second Approximation Third Approximation

From the above figure we can easily note the following points about Hilbert’s
Curve.
a) If we infinitely extend the approximation to the Hilbert’s curve the curve fills
the smaller quadrants but never cross itself.
b) The curve is close to every point in the square.
c) The curve passes through a point on a grid, which becomes twice as fine with
each subdivision.
d) There is no limit to subdivision & therefore length of curve is infinite.
e) With each subdivision length of curve increases by factor of 4.
f) At each subdivision the scale changes by 2but length changes by 4 therefore for
Hilbert’s curve Topological Dimension is one but the fractal Dimension is 2.

 Koch curve:-
 The Koch Curve can be drawn by dividing line into 4 equal segments with scaling
factor 1/3 & middle two segments are so adjusted that they form adjacent sides of an
equilateral triangle as shown in first approximation of the curve.
 To apply the second approximation to the Koch curve we have to repeat the above
process for each of the four segments. The resultant curve as shown in second
approximation curve.
 The resultant curve has more wiggles & its length is 16/9 times the original length.

From the above fig. we can easily note the following points about the Koch
curve:
a) Each repetition increases the length of the curve by factor 4/3.
b) Length of curve is infinite.
c) Unlike Hilbert’s Curve , It doesn’t fill an area.
d) It doesn’t deviate much from its original shape.
e) If we reduce the scale of the curve of the curve by 3, we find the curve that
looks just like the original one; but we must assemble 4 such to make the
original , so we have 4=3D
f) Solving for D we get D=log3 4 = log 4 / log 3=1.2618
Therefore for Koch Curve Topological dimension is 1 but fractal dimension I
1.2618.

Common questions

Powered by AI

The fractal dimension of a curve quantifies its complexity by relating the number of self-similar pieces to the scale factor. For the Koch curve, which is iteratively constructed by adding triangular patterns, its fractal dimension is 1.2618 . This implies it has a more complex geometric structure than a simple line but it does not fill a 2D area. In contrast, the Hilbert curve, constructed by continuously subdividing and reordering its paths within a square, ultimately approaches a plane-filling path, therefore having a fractal dimension of 2 . The dimension indicates that as more iterations are applied, the curve increasingly fills the two-dimensional space.

Fractal dimensions provide a mathematical means of quantifying the complexity of self-similar structures, distinguishing between curves like Koch and Hilbert. The Koch curve increases its length with each iteration while maintaining a visually consistent structure, having a fractal dimension of approximately 1.2618, which indicates its geometry has more complexity than a simple line but does not fill a space . Conversely, the Hilbert curve, through its iterative process, approximates filling a two-dimensional space, resulting in a fractal dimension of 2, indicating a higher degree of complexity as it fills a plane . Thus, fractal dimensions highlight the distinct space-filling properties and inherent complexities of these curves.

Bezier curves are defined by a set of control points and follow the shape of their control polygon. They always pass through the first and last control points and exhibit global control, meaning that moving a single control point affects the entire curve . B-spline curves, on the other hand, provide local control, as moving a control point only affects a specific part of the curve determined by its non-zero basis function . B-splines are also more adaptable due to their ability to specify order and degree separately and support approximation rather than requiring interpolation through all control points . Additionally, B-splines allow the curve to adhere closely to the shape of its defining polygon .

Control points are pivotal in defining the shape and properties of both Bezier and spline curves. In Bezier curves, the control points determine the tangents and curvature of the curve through their influence on the Bernstein polynomials that mathematically define the curve . The curve generally mirrors the shape of the control polygon formed by these points, thus providing a predictable control mechanism . For spline curves, control points serve as the basic framework through which the cubic polynomial sections are fitted, ensuring that the derivatives remain continuous across curve sections to maintain smoothness . The precise positioning of control points in splines directly impacts the local shape and behavior of the curve.

Parametric curves are defined by a set of equations depending on one or more parameters to specify vertex coordinates, providing flexibility in manipulating curve shapes, especially in 3D applications where smoothness and continuity are critical . This allows for dynamic changes through parameter adjustments, beneficial in animation and modeling complex surfaces. Non-parametric curves consist of explicitly defined vertices connected by straight lines, offering simplicity and ease of use, but their shape modifications usually require altering the vertex set directly, limiting flexibility compared to parametric curves . Hence, parametric curves are preferred for applications requiring precision and smooth transitions, while non-parametric curves are suited for straightforward graphical elements.

Advantages of spline curves include their ability to produce smooth shapes with a relatively small number of control points and their applicability in representing outlines in 2D or as patches in 3D for animation paths . However, spline curves can be difficult to control precisely without extensive manipulation of control points. This difficulty arises from their reliance on mathematical definitions requiring continuity of first and second derivatives across curve sections, which can complicate the specification of exact shapes .

Fractals provide significant advantages in modeling natural phenomena due to their ability to replicate the complex, irregular patterns found in nature which traditional geometric models struggle to capture. Fractals, such as those used to model mountain landscapes, clouds, or coastlines, embody self-similarity, capturing the essence of natural shapes that exhibit repeating patterns at different scales . This enables a realistic simulation of natural textures and structures, such as the intricacy of tree branches or the roughness of terrain, beyond the simplicity of standard shapes. Furthermore, fractals are computationally efficient, allowing complex natural features to be constructed with minimal data input, aiding in fields like computer graphics, animation, and environmental modeling .

Fractals are widely utilized in scientific and artistic fields due to their ability to model naturally occurring complex patterns. In astronomy, fractals help analyze the structure of galaxies and planetary rings, such as those of Saturn . In biology and chemistry, they depict the growth patterns of bacteria cultures, the structures of molecules and human anatomy, and chemical reactions . Fractals also find artistic applications in generating realistic landscapes and special effects, as well as in fractal art and music due to their inherent complexity and self-similarity . Specific examples include modeling terrain, clouds, and coastlines, where fractals replicate the appearance of natural roughness and intricacy .

Hilbert’s curves serve as an excellent model for understanding both Topological and Fractal Dimensions due to their method of construction and end behavior. By iteratively subdividing a square into smaller quadrants and plotting a continuous path through them, Hilbert’s curves exemplify a transformation from a one-dimensional topological path into a two-dimensional space-filling object, highlighting the concept of fractal dimension being higher than its topological counterpart . Educationally, these curves illustrate the transition between simple and complex dimensions, providing a visual and interactive tool for teaching mathematical concepts of dimensionality, iteration, and recursion in geometry and topology courses. They reveal how space-filling curves can transition from line-like to area filling which is a challenging concept for many students to grasp abstractly.

The DDA algorithm generates circular arcs by incrementally plotting points along the arc using the parametric equations x = Rcosɵ + x0 and y = Rsinɵ + y0, where (x0, y0) is the center and R is the radius . The algorithm differentiates the parametric equations to compute the incremental changes dx and dy, which ensure that each new point is plotted at a consistent angle increment ɵ. To achieve smooth curves, the angle increment ɵ (dɵ) needs to be small enough to prevent visible gaps between successive points. It is calculated as the minimum of 0.01 and 1/(3.2*(|x-x0| + |y-y0|)). This consideration is crucial to ensure that the generated curve appears continuous and smooth.

You might also like