today: circles, ellipses, lines in 3d, (hyper)planes and
TRANSCRIPT
![Page 1: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/1.jpg)
Graphics (INFOGR), 2018-19, Block IV, lecture 3
Deb Panja
Today: Circles, ellipses, lines in 3D,(hyper)planes and cross product
Welcome
1
![Page 2: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/2.jpg)
Today
• Circles, ellipses and shooting rays
• Lines and planes in 3D
• Cross products of vectors
• (Hyper)planes and normals
2
![Page 3: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/3.jpg)
Circles, ellipses and shooting rays
3
![Page 4: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/4.jpg)
Equations of circles
• Circle: (x− h)2 + (y − k)2 = r2
(h, k): location of the centre
4
![Page 5: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/5.jpg)
Equations of circles and ellipses
• Circle: (x− h)2 + (y − k)2 = r2
(h, k): location of the centre
• Ellipse: (x− h)2
a2+
(y − k)2
b2= 1
(h, k): location of the centre
a: semi-major axis, b: semi-minor axis
5
![Page 6: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/6.jpg)
Equations of circles and ellipses
• Circle: (x− h)2 + (y − k)2 = r2
(h, k): location of the centre
• Ellipse: (x− h)2
a2+
(y − k)2
b2= 1
(h, k): location of the centre
a: semi-major axis, b: semi-minor axis
(both of the above are implicit forms)
6
![Page 7: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/7.jpg)
Circular co-ordinate system
•[xy
]=
[hk
]+ r ur; ur =?
7
![Page 8: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/8.jpg)
Circular co-ordinate system
•[xy
]=
[hk
]+ r ur; ur =
[cos θsin θ
]; uθ =?
8
![Page 9: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/9.jpg)
Circular co-ordinate system
•[xy
]=
[hk
]+ r ur; ur =
[cos θsin θ
]; uθ =
[− sin θcos θ
]
9
![Page 10: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/10.jpg)
Circular co-ordinate system
•[xy
]=
[hk
]+ r ur; ur =
[cos θsin θ
]; uθ =
[− sin θcos θ
]• Given (h, k) and r, P is described by θ alone:
x = h+ r cos θ, y = k + r sin θ (parametric form)
10
![Page 11: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/11.jpg)
The circular co-ordinate system
•[xy
]=
[hk
]+ r ur; ur =
[cos θsin θ
]; uθ =
[− sin θcos θ
]• Given (h, k) and r, P is described by θ alone:
x = h+ r cos θ, y = k + r sin θ (parametric form)
• ur unit normal vector; uθ unit tangent vector to the circle at P
11
![Page 12: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/12.jpg)
Shooting rays at a circle
• Given: Eye at (x0, y0), ray along v, circle centre at (h, k), radius r
Q. Find locations of P1 and P2
12
![Page 13: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/13.jpg)
Shooting rays at a circle
• Given: Eye at (x0, y0), ray along v, circle centre at (h, k), radius r
Q. Find locations of P1 and P2
A. Shoot a ray from E along v, intersect circle at P1 and P2
13
![Page 14: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/14.jpg)
Shooting rays at a circle
• Given: E at (x0, y0), ray along v, circle centre at (h, k), radius r[xy
]=
[x0y0
]+ l
[vxvy
]; (x− h)2 + (y − k)2 = r2
14
![Page 15: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/15.jpg)
Shooting rays at a circle
• Given: E at (x0, y0), ray along v, circle centre at (h, k), radius r[xy
]=
[x0y0
]+ l
[vxvy
]; (x− h)2 + (y − k)2 = r2
⇒ quadratic equation in l: al2 + bl + c = 0
15
![Page 16: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/16.jpg)
Shooting rays at a circle
• Given: E at (x0, y0), ray along v, circle centre at (h, k), radius r[xy
]=
[x0y0
]+ l
[vxvy
]; (x− h)2 + (y − k)2 = r2
⇒ quadratic equation in l: al2 + bl + c = 0
⇒ l = − b
2a±√b2 − 4ac
2a
16
![Page 17: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/17.jpg)
Shooting rays at a circle
• Given: E at (x0, y0), ray along v, circle centre at (h, k), radius r[xy
]=
[x0y0
]+ l
[vxvy
]; (x− h)2 + (y − k)2 = r2
⇒ quadratic equation in l: al2+bl+c = 0 ⇒ l = − b
2a±√b2 − 4ac
2a⇒ (i) b2− 4ac > 0: (P1,P2); (ii) b2− 4ac = 0: P1 = P2 (tangent ray);
(iii) b2 − 4ac < 0: no intersection; ⇒ (θ1, θ2)-values for P1 and P2
17
![Page 18: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/18.jpg)
Shooting rays at a circle
• Given: E at (x0, y0), ray along v, circle centre at (h, k), radius r[xy
]=
[x0y0
]+ l
[vxvy
]; (x− h)2 + (y − k)2 = r2
⇒ quadratic equation in l: al2+bl+c = 0 ⇒ l = − b
2a±√b2 − 4ac
2a⇒ (i) b2− 4ac > 0: (P1,P2); (ii) b2− 4ac = 0: P1 = P2 (tangent ray);
(iii) b2 − 4ac < 0: no intersection; ⇒ (θ1, θ2)-values for P1 and P2
P2 will not be visible to the eye!
18
![Page 19: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/19.jpg)
Ingredients for 3D, and recap
• Will work in 3D, Cartesian co-ordinates: (x, y, z) reference directions
− in Cartesian co-ordinates x, y and z as basis vectors
• A point P: (x, y, z), a vector ~v =
vxvyvz
− will use vector
xyz
to reach point (x, y, z) from the origin
19
![Page 20: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/20.jpg)
Lines and planes in 3D
20
![Page 21: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/21.jpg)
Shooting a ray for a line in 3D
•
xyz
=
x0y0z0
+ lv =
x0y0z0
+ l
vxvyvz
(parametric form)
• x− x0vx
=y − y0vy
=z − z0vz
(= l) [equivalent slope-intercept form]
21
![Page 22: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/22.jpg)
A plane in 3D
Given: n, normal to the plane, and (x0, y0, z0) on the plane
Q. What is the equation of this plane?
(uses: storing a plane in the memory, distance to the plane. . .)
22
![Page 23: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/23.jpg)
A plane in 3D
Given: n, normal to the plane, and (x0, y0, z0) on the plane
Q. What is the equation of this plane?
A. Plane equation: (x− x0)nx + (y − y0)ny + (z − z0)nz = 0
23
![Page 24: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/24.jpg)
A plane in 3D
• Plane equation: (x− x0)nx + (y − y0)ny + (z − z0)nz = 0
nxx+ nyy + nzz − (nxx0 + nyy0 + nzz0) = 0, or
Ax+By + Cz +D = 0︸ ︷︷ ︸implicit form
(recall line in 2D form Ax+By + C = 0)
24
![Page 25: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/25.jpg)
A plane in 3D
• Plane equation: (x− x0)nx + (y − y0)ny + (z − z0)nz = 0
nxx+ nyy + nzz − (nxx0 + nyy0 + nzz0) = 0, or
Ax+By + Cz +D = 0︸ ︷︷ ︸implicit form
(recall line in 2D form Ax+By + C = 0)
• A plane divides the 3D space into two:
for one Ax+By + Cz +D > 0, for the other Ax+By + Cz +D < 0
25
![Page 26: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/26.jpg)
A plane in 3D
• Plane equation: (x− x0)nx + (y − y0)ny + (z − z0)nz = 0
nxx+ nyy + nzz − (nxx0 + nyy0 + nzz0) = 0, or
Ax+By + Cz +D = 0︸ ︷︷ ︸implicit form
(recall line in 2D form Ax+By + C = 0)
• A plane divides the 3D space into two:
for one Ax+By + Cz +D > 0, for the other Ax+By + Cz +D < 0
• Similarly a hyperplane also divides the space into two
26
![Page 27: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/27.jpg)
Cross products of vectors
27
![Page 28: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/28.jpg)
Cross product of vectors
Q. Why?
28
![Page 29: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/29.jpg)
Cross product of vectors
Q. Why?
A. Because it allows us to easily switch between planes and their normals
29
![Page 30: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/30.jpg)
Cross product of two vectors
• ~u =
uxuyuz
; ~v =
vxvyvz
~w = ~u× ~v =
uyvz − uzvyuzvx − uxvzuxvy − uyvx
: a vector
~u× ~v = −~v × ~u
30
![Page 31: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/31.jpg)
Cross product of two vectors
• ~u =
uxuyuz
; ~v =
vxvyvz
~w = ~u× ~v =
uyvz − uzvyuzvx − uxvzuxvy − uyvx
: a vector
~u× ~v = −~v × ~u
• Geometric interpretation:
~w ⊥ (~u,~v); ~w · ~u =?
31
![Page 32: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/32.jpg)
Cross product of two vectors
• ~u =
uxuyuz
; ~v =
vxvyvz
~w = ~u× ~v =
uyvz − uzvyuzvx − uxvzuxvy − uyvx
: a vector
~u× ~v = −~v × ~u
• Geometric interpretation:
~w ⊥ (~u,~v); ~w · ~u = ~w · ~v = 0
||~w|| = ||~u|| ||~v|| sin θ
32
![Page 33: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/33.jpg)
Cross product of two vectors
• ~u =
uxuyuz
; ~v =
vxvyvz
~w = ~u× ~v =
uyvz − uzvyuzvx − uxvzuxvy − uyvx
: a vector
~u× ~v = −~v × ~u
• Geometric interpretation:
~w ⊥ (~u,~v); ~w · ~u = ~w · ~v = 0
||~w|| = ||~u|| ||~v|| sin θ~u and ~v are parallel; ~w = ~u× ~v =?
33
![Page 34: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/34.jpg)
Cross product of two vectors
• ~u =
uxuyuz
; ~v =
vxvyvz
~w = ~u× ~v =
uyvz − uzvyuzvx − uxvzuxvy − uyvx
: a vector
~u× ~v = −~v × ~u
• Geometric interpretation:
~w ⊥ (~u,~v); ~w · ~u = ~w · ~v = 0
||~w|| = ||~u|| ||~v|| sin θ~u and ~v are parallel; ~w = ~u× ~v = 0
34
![Page 35: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/35.jpg)
Cross product and handedness of a co-ordinate system
• Right-handed co-ordinate system: x× y = z, y × z = x, z × x = y
i.e., (x× y) · z > 0 etc.
(this is what we will use)
35
![Page 36: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/36.jpg)
Cross product and handedness of a co-ordinate system
• Right-handed co-ordinate system: x× y = z, y × z = x, z × x = y
i.e., (x× y) · z > 0 etc.
(this is what we will use)
• Left-handed co-ordinate system: x× y = −z, y × z = −x, z × x = −yi.e., (x× y) · z < 0 etc.
36
![Page 37: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/37.jpg)
(Hyper)planes and normals
37
![Page 38: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/38.jpg)
Revisit: (hyper)planes and normals
• Plane equation Ax+By + Cz +D = 0 (implicit form)
like line in 2D, normal n || ±
ABC
likewise, (shortest) distance from
the origin is|D|√
A2 +B2 + C2
(similarly for hyperplanes)
38
![Page 39: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/39.jpg)
Revisit: (hyper)planes and normals
• Plane equation Ax+By + Cz +D = 0 (implicit form)
like line in 2D, normal n || ±
ABC
likewise, (shortest) distance from
the origin is|D|√
A2 +B2 + C2
(similarly for hyperplanes)
• Plane using two (planar) vectors (parametric form) xyz
=
x0y0z0
+ lu+ tv
(similarly for hyperplanes)
39
![Page 40: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/40.jpg)
Revisit: (hyper)planes and normals
• Plane using two (planar) vectors (parametric form) xyz
=
x0y0z0
+ lu+ tv
(similarly for hyperplanes)
n || u× v Q. Given ~u and ~v on a plane can you calculate n?
40
![Page 41: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/41.jpg)
Revisit: (hyper)planes and normals
• Plane using two (planar) vectors (parametric form) xyz
=
x0y0z0
+ lu+ tv
(similarly for hyperplanes)
n || u× v A. Given ~u and ~v on a plane n = ~u× ~v/||~u× ~v||for u ⊥ v, (u, v, n) form a right-handed co-ordinate system
in that case, normal n, tangent u, bitangent v
41
![Page 42: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/42.jpg)
Summary: circles, ellipses, (hyper)planes and cross product
• Circles, ellipses and shooting rays at them
• Shooting rays as a line in 3D
− equations: parametric and implicit-like forms
• Equation of a plane using the normal vector
• Cross product, left- and right-handed co-ordinate systems
− implicit and parametric equations of a plane
− tangent and bitangent vectors
42
![Page 43: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/43.jpg)
Summary: circles, ellipses, (hyper)planes and cross product
• Circles, ellipses and shooting rays at them
• Shooting rays as a line in 3D
− equations: parametric and implicit-like forms
• Equation of a plane using the normal vector
• Cross product, left- and right-handed co-ordinate systems
− implicit and parametric equations of a plane
− tangent and bitangent vectors
• Next class: primitives (continued) and projections in 3D
43
![Page 44: Today: Circles, ellipses, lines in 3D, (hyper)planes and](https://reader031.vdocument.in/reader031/viewer/2022012916/61c6d6581a941c17800b24ac/html5/thumbnails/44.jpg)
Finally, references
• Book chapter 2: Miscellaneous Math
− Sec. 2.2, Sec. 2.4.4, 2.4.6-2.4.7
− Sec. 2.5, the relevant parts for 3D
44