Presentation is loading. Please wait.

Presentation is loading. Please wait.

Coordinate systems. Coordinate systems Cartesian Polar Cylindrical Spherical.

Similar presentations


Presentation on theme: "Coordinate systems. Coordinate systems Cartesian Polar Cylindrical Spherical."— Presentation transcript:

1 Coordinate systems

2 Coordinate systems Cartesian Polar Cylindrical Spherical

3 TBD: Describing 2D polar coordinates. examples where polar coordinates are preferable to Cartesian coordinates. Conversion between Cartesian and Polar how polar space works in 3D and introduces cylindrical and spherical coordinates.

4 2D Polar Coordinates Chapter 7 Notes3D Math Primer for Graphics & Game Dev4

5 Polar Coordinate Space Recall that 2D Cartesian coordinate space has an origin and two axes that pass through the origin. A 2D polar coordinate space also has an origin (known as the pole), which has the same basic purpose: it defines the center of the coordinate space. A polar coordinate space only has one axis, sometimes called the polar axis, which is usually depicted as a ray from the origin.

6

7 In Cartesian coordinates we described a 2D point using the using two signed distances, x and y. Polar coordinates use a distance and an angle. By convention, the distance is usually called r (which is short for radius) and the angle is usually called θ.

8

9 Polar Diagrams The grid circles show lines of constant r. The straight grid lines that pass through the origin show lines of constant θ, consisting of points that are the same direction from the origin.

10 Some Ponderable Questions! 1.Can the radial distance r ever be negative? 2.Can θ ever go outside of –180°≤ θ ≤ 180°? 3.The value of the angle directly west of the origin (i.e. for points where x < 0 and y = 0 using Cartesian coordinates) is ambiguous. Is θ equal to +180° or – 180° for these points? 4.The polar coordinates for the origin itself are also ambiguous. Clearly r = 0, but what value of θ should we use? Wouldn't any value work?

11 We agree that, as shown, the points (–r, θ) and (r, θ) lie on the same line through O and at the same distance | r | from O, but on opposite sides of O.

12 If r > 0, the point (r, θ) lies in the same quadrant as θ. If r < 0, it lies in the quadrant on the opposite side of the pole. – Notice that ( – r, θ) represents the same point as (r, θ + π).

13 Aliasing For any given point, there are infinitely many polar coordinate pairs that can be used to describe that point. This phenomenon is known as aliasing. Two coordinate pairs are said to be aliases of each other if they have different numeric values but refer to the same point in space. Notice that aliasing doesn't happen in Cartesian space. Each point in plane is assigned exactly one (x, y) coordinate pair.

14 For instance, the point (1, 5π/4) could be written as: (1, –3π/4), (1, 13π/4), or (–1, π/4).

15 True/False The point represented by polar coordinates (r, θ) is also represented by (r, θ + 2nπ) and (-r, θ + (2n + 1)π) where n is any integer.

16 Canonical Polar Coordinates A polar coordinate pair (r, θ) is in canonical form if all of the following are true:

17 Algorithm to Make (r, θ) Canonical 1.If r = 0, then assign θ = 0. 2.If r < 0, then negate r, and add 180° to θ. 3.If θ ≤ -180°, then add 360° until θ > –180° 4.If θ > 180°, then subtract 360° until θ ≤ 180°.

18 Plot the points whose polar coordinates are given. a.(1, 5π/4) b.(2, 3π) c.(2, –2π/3) d.(–3, 3π/4) Example 1

19 The point (1, 5π/4) is plotted here. Example 1 a

20 The point (2, 3π) is plotted. Example 1 b

21 The point (2, –2π/3) is plotted. Example 1 c

22 The point (–3, 3π/4) is plotted. – It is is located three units from the pole in the fourth quadrant. – This is because the angle 3π/4 is in the second quadrant and r = -3 is negative. Example 1 d

23 Converting from Polar to Cartesian Coordinates in 2D x = r cos θ y = r sin θ

24 Converting from Cartesian to Polar Coordinates in 2D Due to aliasing, there isn't only one right answer; there are infinitely many (r, θ) pairs that describe the point (x, y). Usually, we want canonical coordinates. We can easily compute r using Pythagoras's theorem

25 Solve for θ

26 Pause for Thought There are two problems with this approach. 1. If x = 0, then the division is undefined. 2.The second is that arctan has a range from –90° to +90°. The basic problem is that the division y/x effectively discards some useful information when x = y. Both x and y can either be positive or negative, resulting in four different possibilities, corresponding to the four different quadrants that may contain the point. But the division y/x results in a single value.

27 Convert the point (2, π/3) from polar to Cartesian coordinates. Example 2

28 Represent the point with Cartesian coordinates (1, –1) in terms of polar coordinates. Example 3

29 Example-4 Express the equation y = 1 in polar coordinates

30 Example-5 Express the polar equation r = 2cosθ in rectangular coordinates.

31 Why we Use Polar Coordinates? Chapter 7 Notes3D Math Primer for Graphics & Game Dev31

32 Why Use Polar Coordinates? They’re better for humans (eg. “I live 15km NE of Louhu, Shenzhen) They’re useful in video games Makes computation of complex numbers easier Sometimes we even use 3D spherical coordinates for locating things on the globe – latitude and longitude.

33 Useful for graphing complicated shapes like:

34 3D Polar Space There are two kinds: 1.Cylindrical coordinates – 1 angle and 2 distances 2.Spherical coordinates – 2 angles and 1 distance

35 Question of the day! a.For the cardioid r = 1 + sin θ, find the slope of the tangent line when θ = π/3. b.Find the points on the cardioid where the tangent line is horizontal or vertical.


Download ppt "Coordinate systems. Coordinate systems Cartesian Polar Cylindrical Spherical."

Similar presentations


Ads by Google