Download presentation
Presentation is loading. Please wait.
1
nine a little more geometry
2
2D space Positions in space are represented by coordinate pairs (x,y) Distances along axes (X & Y) Relative to an origin (0, 0) 2D computer graphics often point the Y axis down 2D space is often called ℝ 2 ℝ eal numbers 2 dimensions The grid is ℤ 2 2 integers ℤ ahl is German for “integer” x axis y axis x axis y axis Axes in math Axes in CG
3
3D space ℝ 3 is the set of points in 3- space Defined by (x,y,z) coordinates Remember: axes are a matter of convention Z commonly points forward But also often points backward or up x axis y axis z axis x axis z axis y axis
4
Shifting and scaling of vectors Single numbers are called scalars Coordinate pairs are sometimes called vectors Many math texts distinguish between points and vectors We won’t Addition and multiplication have natural geometric interpretations One of the strengths of analytic geometry Addition means shifting (translating) Multiplication by a scalar means stretching and shrinking the vector Arithmetic rules: Shifting a vector (x 1, y 1 ) + (x 2,y 2 ) means (x 1 +x 2, y 1 +y 2 ) Growing/shrinking a vector k × (x,y) a.k.a. k(x,y) means (kx, ky) Can’t multiply or divide two vectors What would it mean?
5
Shifting and scaling of vectors a 1.5a (50% longer) 2a (twice as long) b+a b+1.5a b+2a b origin -0.5a ?
6
Lines Notice: scaling a vector forms a line through the origin Any other line can be formed by shifting a line through the origin We can think of a line as: A set of points That are related by shifting A function From distance along the line To position Formed by Starting position Plus distance × a vector We can also think of other kinds of curves as sets and functions l = { s + dv for all d } l = { (x,y) | y = mx + b } f(d) = s + dv = (s x,s y ) + d(v x,v y ) = (s x +dv x, s+dv y ) x axis y axis
7
Circles A circle is the set of points that are a given distance of a given point The point is the center The distance is the radius So we can use the Pythagorean theorem to work out which points those are Remember the distance squared between two points Is the sum of the squares of the differences of their coordinates circle = { (x,y) | x 2 +y 2 =r 2 } r is the radius “|” means “such that” (x,y)(x,y) (0,0)
8
Sine and cosine The sine and cosine functions are unbelievably useful Given an angle, they give you the coordinates of a point on a “unit circle” A circle with radius 1 About the origin (0,0) Angles are measured in Degrees, or Radians: distance about the unit circle circle = { (cos θ, sin θ ) | 0≤ θ ≤2 π } c( θ ) = (cos θ, sin θ ) (cos θ, sin θ) θ sin θ cos θ 1 (0,0)
9
Sine and cosine The sine and cosine functions are unbelievably useful Given an angle, they give you the coordinates of a point on a “unit circle” A circle with radius 1 About the origin (0,0) Angles are measured in Degrees, or Radians: distance about the unit circle circle = { (cos θ, sin θ ) | 0≤ θ ≤2 π } c( θ ) = (cos θ, sin θ ) (cos θ 2, sin θ 2 ) cos θ 2 sin θ 2 θ2θ2
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.