0% found this document useful (0 votes)
12 views

Unit -2 Concepts of Various Objects

The document outlines fundamental geometric concepts including points, lines, circles, ellipses, and polygons, detailing their characteristics and types. It also discusses line drawing algorithms such as DDA and Bresenham's, highlighting their advantages and disadvantages. Additionally, it covers the importance of line styles, caps, and joins in visual art and graphic design.

Uploaded by

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

Unit -2 Concepts of Various Objects

The document outlines fundamental geometric concepts including points, lines, circles, ellipses, and polygons, detailing their characteristics and types. It also discusses line drawing algorithms such as DDA and Bresenham's, highlighting their advantages and disadvantages. Additionally, it covers the importance of line styles, caps, and joins in visual art and graphic design.

Uploaded by

Hemanshi Tandel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 31

CONCEPTS OF

VARIOUS
OBJECTS
POINT
• A geometrical point is a location in space.
• It has no other characteristics. It has no length, width, or thickness. It is pure
location.
• The phrase "location in space" designates the same concept as the word
"point".
• In geometry, the word point is not defined. It is one of the undefined primitives
that are used to define other objects.
LINE
• The physical characteristics of line are many.
• Lines may be short or long, thin or
thick, straight or curved,
direct or meandering, zigzag or serpentine, distinct or
blurred.
• Measure refers to the length and width of line – its meas
urable properties.
• A line may be of any length and breadth.
• Thin lines are generally more elegant, gentle, or delicate.
CHARACTERISTIC OF LINE
ARE:
• Width - thick, thin, tapering, uneven.
• Length - long, short, continuous, broken.
• Direction- horizontal, vertical, diagonal, curving, perpendicular, oblique,
parallel, radial, zigzag.
• Focus- sharp, blurry, fuzzy, choppy.
• Feeling- sharp, jagged, graceful, smooth.
TYPES OF LINES

• Vertical Lines: These are perfectly straight lines extending up and down.
• Horizontal Lines: These are also perfectly straight lines, but they extend
side to side.
• Diagonal Lines: Again, these are straight lines, but their direction has both a
vertical and a horizontal direction.
• There are many different types of line. If the line continues in only one direction, it i
s straight;
• if changes of direction gradually occur, it is curved;
• if those changes are sudden and abrupt, an angular line is created.
• By joining the characteristics of
measure and type, we find that long, short, thick, or thin lines can be straight,
angular, or curved.
• A straight line, in its continuity, ultimately seems stiff and rigid
and, if rendered thinly, may appear brittle.
• The curved line may form an arc, reverse its curve to become wavy, or continue
turning within itself to produce a spiral.
• Alterations of movement become visually entertaining and physically stimulating if
they are rhythmical. A curved line is inherently graceful and, to a degree, unstable.
CIRCLE
• Circle is a set of points in the XY-plane at a fixed
distance from a centre point (x,y).
• The centre point is called the centre of the circle and the
fixed distance is called the radius of the circle, and the
length of the circle is called its circumference.
• The longest distance from one end of the circle to the
other is called the diameter of the circle.
• Circle is an eight-way symmetric figure.
• The shape of circle is the same in all quadrants.
• In each quadrant, there are two octants.
• If the calculation of the point of one octant is done, then
the other seven points can be calculated easily by using
the concept of eight-way symmetry.
• Any Continuous part of a circle is called an arc.
• A line segment within a circle that touches two points
on the circle is called a chord.
• Diameter of the circle is the longest chord.
ELLIPSE
• Ellipse is a geometrical shape on a plane where
the sum of the distances from any point on the
curve to two fixed points within the curve is
constant. These two points are called the foci
points of the ellipse.
• An ellipse is the set of all points (x, y) in a plane,
the sum of whose distances from two distinct
fixed points, foci, is constant.
• The line through the foci intersects the ellipse at
two points called vertices. The chord joining the
vertices is the major axis, and its midpoint is the
center of the ellipse.
POLYGON

• Polygon is a representation of the surface. It is primitive which is closed in nature.


It is formed using a collection of lines. It is also called as many-sided figure.
• The lines combined to form polygon are called sides or edges. The lines are
obtained by combining two vertices.
• Example of Polygon:
• Triangle
• Rectangle
• Hexagon
• Pentagon
DDA LINE ALGORITHM

• DDA stands for Digital Differential Analyzer. It is an incremental method


of scan conversion of line.
• It works on incremental method. It plots the point from source to
destination by incrementing the source coordinates.
• In this method calculation is performed at each step but by using results of
previous steps.
DDA ALGORITHM:
• Step1: Start Algorithm
• Step2: Declare x1,y1,x2,y2,dx,dy,x,y as integer variables.
• Step3: Enter value of x1,y1,x2,y2.
• Step4: Calculate dx = x2-x1
• Step5: Calculate dy = y2-y1
• Step6: If ABS (dx) > ABS (dy)
Then step = abs (dx)
Else
• Step7: xinc=dx/step
yinc=dy/step
assign x = x 1
assign y = y 1
• Step8: Set pixel (x, y)
• Step9: x = x + xinc
y = y + y inc
Set pixels (Round (x), Round (y))
• Step10: Repeat step 9 until x = x 2
• Draw a line from P(1,1) to Q(5,9) using DDA algorithm.
• Draw a line from P(2,2) to Q(6,6) using DDA algorithm.
• Calculate the points between the starting point (5, 6) and ending point (8,
12).
• Advantage:
• It is a faster method than method of using direct use of line equation.
• This method does not use multiplication theorem.
• It allows us to detect the change in the value of x and y ,so plotting of same
point twice is not possible.
• This method gives overflow indication when a point is repositioned.
• It is an easy method because each step involves just two additions.
• Disadvantage:
• It involves floating point additions rounding off is done. Accumulations of
round off error cause accumulation of error.
• Rounding off operations and floating point operations consumes a lot of
time.
• It is more suitable for generating line using the software. But it is less suited
for hardware implementation.
BRESENHAM'S LINE
ALGORITHM
• This algorithm is used for scan converting a line. It was developed by
Bresenham.
• It is an efficient method because it involves only integer addition,
subtractions, and multiplication operations.
• These operations can be performed very rapidly so lines can be generated
quickly.
• In this method, next pixel selected is that one who has the least distance
from true line.
• Assume a pixel P1'(x1',y1'),then select subsequent pixels as we work our may
to the night, one pixel position at a time in the horizontal direction toward
P2'(x2',y2').
• Once a pixel in choose at any step The next pixel is :
– Either the one to its right (lower-bound for the line)
– One top its right and up (upper-bound for the line)
• To chooses the next one between the bottom pixel S and top pixel T.
If S is chosen
We have xi+1=xi+1 and yi+1=yi
If T is chosen
We have xi+1=xi+1 and yi+1=yi+1
• The actual y coordinates of the line at x = xi+1is
y=mxi+1+b
• The distance from S to the actual line in y direction
s = y-yi
• The distance from T to the actual line in y direction
t = (yi+1)-y
• Now consider the difference between these 2 distance values
s-t
• When (s-t) <0 ⟹ s < t
• The closest pixel is S
• When (s-t) ≥0 ⟹ s < t
• The closest pixel is T
Step1: Start Algorithm
Step2: Declare variable x1,x2,y1,y2,d,i1,i2,dx,dy
Step3: Enter value of x1,y1,x2,y2
Where x1,y1are coordinates of starting point
And x2,y2 are coordinates of Ending point
Step4: Calculate dx = x2-x1
Calculate dy = y2-y1
Calculate i1=2*dy
Calculate i2=2*(dy-dx)
Step 5 : Calculate slope (M)
m= dy/dx
Step 6: if m > 0
CHECK SLOPE (M)

• If m < 1 • If m > 1
• Pk= 2dy –dx • Pk = 2dx- dy
• Pk+1 = Pk + 2dy -2dx(yk+1,yk) • Pk+1 = Pk + 2dx -2dy (xk+1,xk)
• If Pk >= 0 • If Pk >=0
yk+1 = yk +1 xk+1 = xk + 1

NC = (xk +1, yk+1) • NC = (xk+1, yk+1)


If Pk< 0 • If Pk < 0
yk+1 = yk • xk+1 = xk
NC (xk +1, yk) • NC = (xk, yk+1)
• Advantage:
• 1. It involves only integer arithmetic, so it is simple.
• 2. It avoids the generation of duplicate points.
• 3. It can be implemented using hardware because it does not use
multiplication and division.
• 4. It is faster as compared to DDA (Digital Differential Analyzer) because it
does not involve floating point calculations like DDA Algorithm.
• Disadvantage:
• 1. This algorithm is meant for basic line drawing only Initializing is not a
part of Bresenham's line algorithm. So to draw smooth lines, you should
want to look into a different algorithm.
Line Drawing Digital Differential Analyzer Bresenhams Line Drawing Algorithm
Algorithm
Arithmetic DDA algorithm uses floating Bresenhams algorithm uses fixed
points i.e. Real Arithmetic. points i.e. Integer Arithmetic.
Operations DDA algorithm Bresenhams algorithm uses
uses multiplication and division in its only subtraction and addition in its
operations. operations.
Speed DDA algorithm is rather slowly than Bresenhams algorithm is faster than DDA
Bresenhams algorithm in line drawing algorithm in line drawing because it
because it uses real arithmetic performs only addition and subtraction in its
(floating-point operations). calculation and uses only integer arithmetic
so it runs significantly faster.
Accuracy & DDA algorithm is not as accurate and Bresenhams algorithm is more efficient and
Efficiency efficient as Bresenham algorithm. much accurate than DDA algorithm.

Drawing DDA algorithm can draw circles and Bresenhams algorithm can draw circles and
curves but that are not as accurate as curves with much more accuracy than DDA
Bresenhams algorithm. algorithm.

Round Off DDA algorithm round off the Bresenhams algorithm does not round
coordinates to integer that is nearest to off but takes the incremental value in its
the line. operation.
Expensive DDA algorithm uses an enormous Bresenhams algorithm is less expensive
number of floating-point multiplications than DDA algorithm as it uses only addition
so it is expensive. and subtraction.
LINE

• As an element of visual art and graphic design, line is perhaps the most
fundamental.
• In art, line is the path a dot takes as it moves through space and it can
have any thickness as long as it is longer than it is wide.
• Not only can a line be a specifically drawn part of your composition, but it
can even be an implied line where two areas of color or texture meet.
• This means that any shapes you use, even if they are not outlined, are
bound by lines.
TYPES OF LINES
• Lines do not have to be perfectly straight, but if
you've ever watched a toddler scribbling, you
already knew that.
• Here are a few types of lines commonly used in
art. They are defined by the path they take.
• Vertical Lines: These are perfectly straight lines
extending up and down.
• Horizontal Lines: These are also perfectly straight
lines, but they extend side to side.
• Diagonal Lines: Again, these are straight lines, but
their direction has both a vertical and a horizontal
direction.
• Curved Lines: These lines bend so that they are
not perfectly straight.
STYLES OF LINES

• In addition to the types of lines, artists and graphic designers use a variety
of line styles.
• Some lines are longer than others, some are thicker than others, while
some even change direction in order to zigzag or become wavy lines with
curve changes.
• Continuous Lines: These are solid lines drawn from one point to another.
They can be straight or curvy as long as they do not stop and restart at any
point.
• Interrupted Lines: These lines are the opposite of continuous lines. The
line's path still exists from one point or another, but there are gaps in the
illustration along the way. Two common types of interrupted lines are dotted
lines and dashed lines.
• Implied Lines: They are lines that are not drawn but exist at the point where
one area of color or texture touches another area of color or texture.
• linestyle specifies in which of several styles subsequent lines will be drawn (such
as solid, dotted, centered, dashed).

• thickness specifies whether the width of subsequent lines drawn will be normal or
thick.
LINE CAPS AND JOINS
• Since strokes have a width, they create a shape.
• The shape of the line caps and the line joins are controlled by the stroke-
linecap and stroke-linejoin attributes, respectively.
• Baring unreasonable expectations, the two attributes provide all the control
over the shape of the stroke you should ever need.
LINE CAPS
• The stroke-linecap attribute defines the shape of the stroke at the start and end
of lines.
• The attribute jointly controls the start and finish. This is used with paths and
shapes like polygons.

Value Comments
Ends the stroke flush with the
butt start or end of the line. This is
the initial value.
Ends the line with a circle the
round
diameter of the stroke.
squar Extends the line to match the
e stroke's thickness.
inherit The default value.
LINE JOINS

• The stroke-linejoin attribute defines the shape of the stroke used at the
joints of paths and shapes like polygons.
• Like line caps, joints cannot be individually specified.
• The default is miter which extends the stroke to where the edges on each
side bisect.
Value Comments
Extends the stroke to where the
miter edges on each side bisect. This is
the initial value.
Rounds the outside edge with a
round
circle the diameter of the stroke.
Cuts the outside edge off where a
bevel circle the diameter of the stroke

You might also like