Unit-V Introduction to Curves
Second Year Diploma Courses in Computer Science & Engineering / Computer
Engineering / Computer Technology / Information Technology Branch.
Computer Graphics
As per MSBTE ‘I’ Scheme Syllabus
CGR-22318
Unit-V
INTRODUCTION TO CURVES
Total Marks- 08
Contents:
5.1 Curve generation:
5.1.1 Arc generation using DDA Algorithm.
5.1.2 Interpolation:
5.2 Types of Curves:
5.2.1 Hilbert’s Curve,
5.2.2 Koch Curve,
5.2.3 B-Spline,
5.2.4 Bezier Curves.
CGR-22318 www.freestudyroom.xyz Page 1
, Unit-V Introduction to Curves
Unit-V Introduction To Curves
5.1 Curve generation:
We can use two approaches to draw curved lines;
One approach is to use a curve generation algorithm such as DDA. In this approach a true
curve is created.
In the second approach the curve is approximated by a number of small straight line
augments. This can be achieved with the help of interpolation techniques.
5.1.1 Arc generation using DDA Algorithm
Digital differential analyzer algorithm uses the differential equation of the curve. We have
already discussed the DDA approach for line drawing in chapter 2. Let us see the DDA
algorithm for generating circular arcs.
The equation for an arc in the angle parameter can be given as,
R
(x0,y0)
x = R cos + x0 (1)
y = R sin + y0 (2)
Where (x0,y0) is the center of curvature, and R is the radius of arc.
By taking differential equation we get,
= + = R (-sin ) + 0
= - R sin
dx = - R sin and (3)
dy = R cos (4)
From equation (1) and (2)
x = R cos + x0
R cos = x - x0 and
R sin = y - y0
Substituting values of R cos and R sin in equation (3) and (4) we get,
dx = - (y - y0)
dy = (x - x0)
It says when we increment by d , x and y will change by dx and dy, respectively. Thus we can find
the new point by adding dx and dy in the current point. So if a current point on the arc is (x1, y1), next
point (x2,y2) can be computed incrementally as follows,
x2 = x1 + dx = x1- (y - y0)
y2 = y1 + dy = y1 + (x - x0)
Usually, the value of can be determined from the following equation.
= Min (0.01, 1/(3.2 (|x-x0| + |y – y0|)))
CGR-22318 www.freestudyroom.xyz Page 2
Second Year Diploma Courses in Computer Science & Engineering / Computer
Engineering / Computer Technology / Information Technology Branch.
Computer Graphics
As per MSBTE ‘I’ Scheme Syllabus
CGR-22318
Unit-V
INTRODUCTION TO CURVES
Total Marks- 08
Contents:
5.1 Curve generation:
5.1.1 Arc generation using DDA Algorithm.
5.1.2 Interpolation:
5.2 Types of Curves:
5.2.1 Hilbert’s Curve,
5.2.2 Koch Curve,
5.2.3 B-Spline,
5.2.4 Bezier Curves.
CGR-22318 www.freestudyroom.xyz Page 1
, Unit-V Introduction to Curves
Unit-V Introduction To Curves
5.1 Curve generation:
We can use two approaches to draw curved lines;
One approach is to use a curve generation algorithm such as DDA. In this approach a true
curve is created.
In the second approach the curve is approximated by a number of small straight line
augments. This can be achieved with the help of interpolation techniques.
5.1.1 Arc generation using DDA Algorithm
Digital differential analyzer algorithm uses the differential equation of the curve. We have
already discussed the DDA approach for line drawing in chapter 2. Let us see the DDA
algorithm for generating circular arcs.
The equation for an arc in the angle parameter can be given as,
R
(x0,y0)
x = R cos + x0 (1)
y = R sin + y0 (2)
Where (x0,y0) is the center of curvature, and R is the radius of arc.
By taking differential equation we get,
= + = R (-sin ) + 0
= - R sin
dx = - R sin and (3)
dy = R cos (4)
From equation (1) and (2)
x = R cos + x0
R cos = x - x0 and
R sin = y - y0
Substituting values of R cos and R sin in equation (3) and (4) we get,
dx = - (y - y0)
dy = (x - x0)
It says when we increment by d , x and y will change by dx and dy, respectively. Thus we can find
the new point by adding dx and dy in the current point. So if a current point on the arc is (x1, y1), next
point (x2,y2) can be computed incrementally as follows,
x2 = x1 + dx = x1- (y - y0)
y2 = y1 + dy = y1 + (x - x0)
Usually, the value of can be determined from the following equation.
= Min (0.01, 1/(3.2 (|x-x0| + |y – y0|)))
CGR-22318 www.freestudyroom.xyz Page 2