Professional Documents
Culture Documents
Curves
Computer-aided design
Modeling Analytic Curves
(Circle)
Computer-aided design
Non-Parametric Representation of a Circle
Generate a unit circle using an Implicit Equation of Circle:
x2 + y2 = 1.
Take equal increment in x (say 0.25) and obtain y.
y = +(1 – x2)1/2
No. x y
1 0 1
2 0,25 0.97
3 0.5 0.86
4 0.75 0.66
5 1 0
Computer-aided design
Observations of
Non-Parametric Representation of a Circle
❑ Resulting intercepts on arc/circle are unequal
and hence poor visual representation.
❑ Calculation of square root is computationally
expensive.
❑ Calculation has to be repeated for every point.
y = +(1 – x2)1/2
No. x y
1 0 1
2 0.25 0.97
3 0.5 0.87
4 0.75 0.66
5 1 0
Computer-aided design
Parametric Representation of a Circle
Generate a circle using a Parametric Equation.
Take equal increments in θ (say π/8) to obtain
coordinates points x and y.
Computer-aided design
We Need an Efficient Algorithm
Parametric Representation of a Circle
Computer-aided design
Need of Efficient Algorithm
Parametric Representation of a Circle
Computer-aided design
Need of Efficient Algorithm
Parametric Representation of an origin centered Circle
The Cartesian coordinates of any point on an origin –
cantered circle are then
xi = r cosui
yi = r sinui ----------------------------------(a)
Let’s take δu as an increment
xi+1 = r cos(ui + δu)
yi+1 = r sin(ui + δu) -------------------------(b)
Using the sum of the angles formulae yields
xi+1 = r (cosui*cosδu - sinui*sinδu)
yi+1 = r (cosui*sinδu + sinui*cosδu) -------(c)
With Equation (a)
xi+1 = xi *cosδu - yi * sinδu
yi+1 = xi *sinδu + yi * cosδu ----------------(d)
Computer-aided design
Need of Efficient Algorithm
Parametric Representation of an origin centered Circle
Recursive Relation
xi+1 = xi *cosδu - yi * sinδu
yi+1 = xi *sinδu + yi * cosδu ----------------(d)
Computer-aided design
Need of Efficient Algorithm
Parametric Representation of an origin centered Circle
xi+1 = xi *cosδu - yi * sinδu
yi+1 = xi *sinδu + yi * cosδu ----------------(d)
❑ Eqn (d) represents the rotation of the point xi and yi by an “δu”.
δu = 2π/n where, n = number of segments
❑ The value of cosδu, sinδu need to be calculated once.
❑ The resulting algorithm represents only four multiples, one
addition and one subtraction in the inner loop. This way the
algorithm becomes efficient.
❑ Thus the circle can start from an arbitrary point and successive
points with equal spacing can be calculated recursively. This
eliminates computation of trigonometric functions for each point.
This algorithm is useful for hardware implementation to speed up
the circle generation and display.
Computer-aided design
Need of Efficient Algorithm
Parametric Representation of a non-origin centered Circle
For a non-origin cantered circle is
obtained by translating an origin-
centered circle of appropriate radius.
Equations (a) and (b) becomes
xi = xc + r.cosui
yi = yc + r.sinui -------(a’)
Computer-aided design
Model Solution
Generate a circle of radius 2 with centre (2,2). Take 8 segments.
No of segments = 8, n = 8. We need n+1 points (starting (θ=0) and
closing point (θ=2π) will coincide).
Computer-aided design
Model Solution
Generate a circle of radius 2 with centre (2,2). Take 8 segments.
For a origin centered circle,
Computer-aided design
Model Solution
Origin centered Non-Origin centered
i
1 2 0 4 2
2 3.414 3.414
3 0 2 2 4
4 0.586 3.414
5 -2 0 0 2
6 0.586 0.586
7 0 -2 2 0
8 3.414 2.586
9 2 0 4 2
Computer-aided design
Efficient Algorithm [Tut]
Generate an efficient algorithm to generate a circle which is (a)
passes through corners of a square (b) which is inscribed in a
square
(a) Passing through corners
Pc = (P1+P3)/2 = OR = (P2+P4)/2
Computer-aided design
Efficient Algorithm [Tut]
Generate an efficient algorithm to generate a circle which is (a)
passes through corners of a square (b) which is inscribed in a
square
Pc = (P1+P3)/2 = OR = (P2+P4)/2
Computer-aided design
Efficient Algorithm [Tut]
Generate an efficient algorithm to generate a circle which is
concentric to existing circle (Black coloured) shown in Fig.
Ri = R-d | Ro = R+d
Computer-aided design
General Problem
Non-parametric equation of a circle is given by x2+y2=R2 where x = R.cos(2πu) and y =
R.Sin(2πu).
(a) Represent Equation of circle in a parametric form
(b) Using the resulting equation, write down the tangent equation
(c) Find out Tangent Equations at 0o, 45o, 90o
(d) Find out slopes at 0o, 45o, 90o
P = [x y]T | x = R.cos(2πu) & y = R.sin(2πu)
Computer-aided design
General Problem
Computer-aided design
Circular Arc
❑Circle and circular arcs are among the most common entities
used in wireframe modelling.
Computer-aided design
Parametric Equation
Computer-aided design
Parametric Line [Tut]
(a) Find P-equations of 2 lines: L1, L2.
(b) Find intersection point (I) of two lines
(c) Find P-equation of Circle (I is center and radius 1)
(d) Find intersection point (II) L1 and C1.
Computer-aided design
Parametric Line [Tut]
Computer-aided design
Parametric Line [Tut]
Computer-aided design
Parametric Line [Tut]
Computer-aided design
Need of Efficient Algorithm (ASSIGNMENT)
Computer-aided design
Modeling Analytic Curves
(Ellipse)
Computer-aided design
Representation of an Ellipse
Database Requirement:
Computer-aided design
Representation of an Ellipse
Equal Angle Increments Method
Computer-aided design
Representation of an Ellipse
Equal segments Method
Computer-aided design
Desired Increments Method: More number of points towards ends
of major axis and less number of points towards ends of minor axis
Computer-aided design
Parametric Representation of an Ellipse
Desired Increments Method: More number of points towards ends
of major axis and less number of points towards ends of minor axis
Any point on ellipse: P(u) = [x y]T
Let: xi = acosui
yi = bsinui
This clearly shows that the desired increments can be easily obtained.
Computer-aided design
Recursive Relation of an Ellipse
Xi+1, yi+1
P-Eqn: P(u) = [acosui bsinui]T
xi, yi
xi = acosui
yi = bsinui ……..(a)
Let’s take δu as an increment
xi+1 = a.cos(ui+δu)
yi+1 = b.sin(ui+δu) -------------------------(b)
Using the sum of the angles formulae yields
xi+1 = a.(cosui*cosδu - sinui*sinδu)……x(b/b)
yi+1 = b.(cosui*sinδu + sinui*cosδu)…..x(a/a)----(c)
Computer-aided design
Recursive Relation of an Ellipse
Xi+1, yi+1
P-Eqn: P(u) = [acosui bsinui]T
xi, yi
Recursive Relation:
xi+1 = xi.cosδu – (a/b). yi.sinδu
yi+1 = (b/a).xi.sinδu +yi.cosδu 0≤u ≤2π
Δu, a & b are constants | 4 multiples | One addition and one
subtraction in inner loop. Algorithm is efficient.
Computer-aided design
Need of Algorithm for
Parametric Representation of an Ellipse
0≤u ≤2π
Recursive relation
0≤u ≤2π
Computer-aided design
Model Solution
Generate an ellipse with semi-major axis a=4 and semi-minor axis
b=1, inclined 30o to the horizontal with center at (2,2). Take 32
segments.
No of segments = 32, n = 32. We need n+1 points (starting (θ=0)
and closing point (θ=2π) will coincide).
Computer-aided design
Model Solution
Computer-aided design
Model Solution
Origin centered
0≤u ≤2π
# ui xi yi
1 0 4.000 0.000
2 π/16 3.923 0.195
3 2π/16 3.696 0.383
4 3π/16 3.326 0.556
5 4π/16 2.828 0.707
6 5π/16 2.222 0.831
7 6π/16 1.531 0.924
8 7π/16 0.780 0.981
9 8π/16 0.000 1.000
Computer-aided design
0≤u ≤2π
Model Center at C(2,2) and Rotation 30o
Center at C(2,2) and Rotation 30o
ui Xi yi
0 5.465 4.000
π/16 5.300 4.131
2π/16 5.009 4.179
3π/16 4.603 4.144
4π/16 4.096 4.027
5π/16 3.509 3.831
6π/16 2.864 3.565
7π/16 2.185 3.240
8π/16 1.500 2.866
Computer-aided design
Tut-1
Find the center, lengths of half the axes and the orientation of an
ellipse defined by it’s circumscribing rectangle
Computer-aided design
Tut-1
Find the center, lengths of half the axes and the orientation of an
ellipse defined by it’s circumscribing rectangle
Computer-aided design
Tut-2
Correlate to its mathematical foundations: Ellipse inscribing a circle of
Radius R2 and circumscribed by a circle of radius R1.
Computer-aided design
THANK YOU !
Computer-aided design