You are on page 1of 34

Coordinate Systems

Chapter 04

IYAD H M ALSHAMI – WDMM 2302 1


Introduction
• This chapter covers
1. Cartesian coordinates,
2. Axial systems,
3. Distance between two points in space
4. Area of simple 2D shapes.
5. Polar systems,
6. Spherical polar systems and
7. Cylindrical coordinate systems.
Cartesian coordinates can be used to pinpoint
where you are on a map or graph.

IYAD H M ALSHAMI – WDMM 2302 2


Applications Coordinate Systems

IYAD H M ALSHAMI – WDMM 2302 3


Cartesian Plane
• It is a plane with a rectangular coordinate system that
associates each point in the plane with a pair of numbers.

• The Cartesian plane, named


after the mathematician Rene
Descartes (1596 - 1650). 

• The Cartesian plane provides a


mechanism for visualizing pairs
of related variables graphically.

IYAD H M ALSHAMI – WDMM 2302 4


Cartesian coordinates
• Any point P on the Cartesian plane is identified by an
ordered pair of numbers (x, y) where x and y are called the
Cartesian coordinates of P .

• Mathematical functions and geometric shapes can be


represented as lists of coordinates inside a computer
program.

IYAD H M ALSHAMI – WDMM 2302 5


Function Graphs
• A wide variety of functions, such as Linear; quadratic; cubic and
trigonometric create familiar graphs.

• Such graphs are used in computer animation to control the


movement of objects, lights and the virtual camera.

• Instead of showing the relationship between x and y, the graphs show


the relationship between an activity such as movement, rotation, size,
brightness, color, etc., and time.

IYAD H M ALSHAMI – WDMM 2302 6


Function Graphs
• Example: A function curve relating brightness to frame
number (time)

IYAD H M ALSHAMI – WDMM 2302 7


Geometric Shapes
• In computer graphics, 2D shapes and 3D objects have a
numerical description of some sort.

• Shapes include polygons, circles, arbitrary curves, mathematical


functions, fractals, etc.

• Objects can be faceted, smooth, bumpy, furry, gaseous, etc.

IYAD H M ALSHAMI – WDMM 2302 8


Polygonal Shapes
• A polygon is constructed from a chain of vertices (points).

• A straight line is assumed to connect each pair of


neighboring vertices.
• intermediate points on the line are not explicitly stored.

• This chain of coordinates are subject to a


variety of arithmetic and mathematical
operations.
• Multiply each point with 2
• Add 2 to each point

• The arithmetic manipulation of vertices is the


basis of shape and object transformation.

IYAD H M ALSHAMI – WDMM 2302 9


Areas of Shapes
• The area of a polygonal shape is calculated from its chain of
coordinates.

* this technique works with any number of


vertices and any arbitrary shape.

IYAD H M ALSHAMI – WDMM 2302 10


Areas of Shapes
• The area of a polygonal shape is calculated from its chain of
coordinates.

IYAD H M ALSHAMI – WDMM 2302 11


Areas of Shapes
• The area of a polygonal shape is calculated from its chain of
coordinates.

t hat
e
d icat kwise
n in cloc
e sig n a
gati are i
v
e ne ces
Th verti
.
the ence
u
seq

IYAD H M ALSHAMI – WDMM 2302 12


Theorem of Pythagoras in 2D
• The theorem of Pythagoras is used to calculate the distance between
two points.
• Assume that and are two arbitrary points, then the distance
between P1 and P2 is given by

wand .

𝑑= √ ( 𝑥 2 − 𝑥 1)2+( 𝑦 2 − 𝑦 1)2

IYAD H M ALSHAMI – WDMM 2302 13


Theorem of Pythagoras in 2D

𝑑3
𝑑4
𝑑2
𝑑1

𝑑 1=√ (1− 3)2+(1− 1)2= √ 4= 2


𝑑 2= √ (3 −3)2 +(1 −2)2= √ 1=1
𝑑 3=√ (3 −1)2 +(2 −3)2 =√ 5=2 .24
𝑑 4= √ (1− 1)2 +(3 −1)2=√ 4 =2
IYAD H M ALSHAMI – WDMM 2302 14
3D Cartesian Coordinates
• Three coordinates are required for 3D space.
• Two coordinates are required to locate a point on the 2D Cartesian
plane.

• The corresponding axial System


• Requires three equally perpendicular axes;
• there are two ways to add the extra z-axis:
• (a) Left-handed System
• Thumb aligns to X-axis
• First finger aligns to Y-axis
• Middle finger aligns to Z-axis
• (b) Right-handed System
• Thumb aligns to X-axis
• First finger aligns to Y-axis
• Middle finger aligns to Z-axis

IYAD H M ALSHAMI – WDMM 2302 15


3D Cartesian Coordinates
• The choice between these axial
systems is arbitrary,

• The main problem


• when projecting 3D points onto a 2D
plane, which has an oriented axial system.
• This will become clear when we look at perspective
projections.
• A right-handed system is used in this book

IYAD H M ALSHAMI – WDMM 2302 16


Theorem of Pythagoras in 3D
• The theorem of Pythagoras in 3D is a natural extension of
the 2D rule.
• In fact, it works in higher dimensions.
• Given two arbitrary points and then the distance d between P1 and
P2 is given by

• where , and

IYAD H M ALSHAMI – WDMM 2302 17


Theorem of Pythagoras in 3D

• Example:
• Find the distance between and

IYAD H M ALSHAMI – WDMM 2302 18


3D Polygons
• The simplest 3D polygon is a triangle, which is always planar
• i.e. the three vertices lie on a common plane.

• Planarity is very important in computer graphics


• Because rendering algorithms normally assume that polygons are
planar.
• For instance, it is quite easy to define a quadrilateral in 3D where the vertices
are not located on one plane.
• but, when such a polygon is rendered and animated, spurious highlights can
result, simply because the geometric techniques (which assume the polygon
is planar) give rise to errors.

• This is why complex polygons are reduced to a collection of triangles.

IYAD H M ALSHAMI – WDMM 2302 19


3D Polygons

IYAD H M ALSHAMI – WDMM 2302 20


Euler’s Rule
• In 1619, Descartes discovered quite a nice relationship
between vertices, edges and the faces of a 3D polygonal
object:
𝐹𝑎𝑐𝑒𝑠+𝑣𝑒𝑟𝑡𝑖𝑐𝑒𝑠=𝑒𝑑𝑔𝑒𝑠+2
• Example:
• cube: it has 12 edges, 6 faces and 8 vertices
• which satisfies Euler’s equation.

• This rule can be applied to a geometric database to discover


whether it contains any spurious features.

IYAD H M ALSHAMI – WDMM 2302 21


Polar Coordinate
• When you ask someone where his/her home is? He/she
often says things like “about 4km north of IUG”.
• They give a distance and direction.
• It is not very often that someone gives the latitude and longitude.

• The use of a distance and direction as a means of describing


position is therefore far more natural than using two
distances on a grid.
• This means of location is used in polar coordinates and bearings.

IYAD H M ALSHAMI – WDMM 2302 22


Polar Coordinate
• A point in the polar coordinate system with pole, fixed
point,  and polar axis .

• Point(3, 60) is the point with radial coordinate 3 and angular coordinate
60 degrees.

• Point(4, 210) is the point with radial coordinate 4 and angular coordinate
210 degrees.

• A polar grid with several angles labeled in degrees.

IYAD H M ALSHAMI – WDMM 2302 23


Polar Coordinate

𝑦=5sin2𝑥 𝑟=5sin ⁡2𝜃


IYAD H M ALSHAMI – WDMM 2302 24
Polar System
• Polar axis – the positive x-axis

• Pole – the point at which the polar axis


begins and any radius begins. (0,0)

• Radius – the first coordinate in an


ordered pair of polar coordinates,
measured from the pole and is a directed
distance.

• Angle – the second coordinate in an


ordered pair of polar coordinates, where
positive direction is measured from the
polar axis in a counter-clockwise
direction. 

IYAD H M ALSHAMI – WDMM 2302 25


Polar Coordinates
• Polar coordinates are used for handling data containing angles, rather
than linear offsets.
Figure shows the convention used for 2D
polar coordinates, where the point has
equivalent polar coordinates where:

IYAD H M ALSHAMI – WDMM 2302 26


Polar Coordinates
• Example:
• Find the polar coordinates, of the Cartesian point (4, 4).

• Then point (4, 4) is equivalent to in the polar coordinates.

IYAD H M ALSHAMI – WDMM 2302 27


Polar Coordinates
• Example:
• Find the Cartesian coordinates, of the polar point .

• Then polar point is equivalent to in the Cartesian coordinates.

IYAD H M ALSHAMI – WDMM 2302 28


Spherical Polar Coordinates
• Any point in 3D Space has an equivalent spherical polar
coordinates, such as point has equivalent polar coordinates ,
where:

IYAD H M ALSHAMI – WDMM 2302 29


5.9 Spherical Polar Coordinates

IYAD H M ALSHAMI – WDMM 2302 30


5.10 Cylindrical Coordinates
• Figure 5.9 shows one convention used for cylindrical
coordinates, where the point has equivalent cylindrical
coordinates , where

IYAD H M ALSHAMI – WDMM 2302 31


Cylindrical Coordinates

IYAD H M ALSHAMI – WDMM 2302 32


That’s all

IYAD H M ALSHAMI – WDMM 2302 33


Quiz
• Find the corresponding Spherical polar coordinates of the Cartesian coordinates
(2,3,4).
• r= 5.385
• = cos-1(4/5.385) = 36.61
• = tan-1(3/2) = 56.31
• Find the corresponding Cylindrical polar coordinates of the Cartesian coordinates
(2,3,4).
• r= 3.606
• = tan-1(3/2) = 56.31
•z=4
• Find the corresponding Cartesian coordinates of the Spherical polar coordinates (4,o,).
• x= 4 sin cos = 1
• y= 4 sin sin = 1.73
• z= 4 cos = 2
• Find the corresponding Cylindrical polar coordinates of the Cartesian coordinates (2, ,4).
• x= 2 cos = 1.73
• y= 2 sin = 1
•z=4

IYAD H M ALSHAMI – WDMM 2302 34

You might also like