12_CM0268_Geometric_Computing2

12_CM0268_Geometric_Computing2 - Lines Curves and Surfaces...

Info icon This preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
CM0268 MATLAB DSP GRAPHICS 1 515 JJ II J I Back Close Lines, Curves and Surfaces in 3D Lines in 3D In 3D the implicit equation of a line is defined as the intersection of two planes . (More on this shortly) The parametric equation is a simple extension to 3D of the 2D form: x = x 0 + ft y = y 0 + gt z = z 0 + ht
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
CM0268 MATLAB DSP GRAPHICS 1 516 JJ II J I Back Close Parametric Lines in 3D v w t w v + t w v 0 = ( x 0 , y 0 , z 0 ) p = ( x, y, z ) x = x 0 + ft y = y 0 + gt z = z 0 + ht This is simply an extension of the vector form in 3D The line is normalised when f 2 + g 2 + h 2 = 1
Image of page 2
CM0268 MATLAB DSP GRAPHICS 1 517 JJ II J I Back Close Perpendicular Distance from a Point to a Line in 3D For the parametric form, x = x 0 + ft y = y 0 + gt z = z 0 + ht This builds on the 2D example we met earlier, line par point dist 2d . The 3D form is line par point dist 3d . dx = g * ( f * ( p(2) - y0 ) - g * ( p(1) - x0 ) ) ... + h * ( f * ( p(3) - z0 ) - h * ( p(1) - x0 ) ); dy = h * ( g * ( p(3) - z0 ) - h * ( p(2) - y0 ) ) ... - f * ( f * ( p(2) - y0 ) - g * ( p(1) - x0 ) ); dz = - f * ( f * ( p(3) - z0 ) - h * ( p(1) - x0 ) ) ... - g * ( g * ( p(3) - z0 ) - h * ( p(2) - y0 ) ); dist = sqrt ( dx * dx + dy * dy + dz * dz ) ... / ( f * f + g * g + h * h ); The value of parameter, t , where the point intersects the line is given by: t = (f * ( p(1) - x0) + g * (p(2) - y0) + h * (p(3) - z0)/( f * f + g * g + h * h);
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
CM0268 MATLAB DSP GRAPHICS 1 518 JJ II J I Back Close Line Through Two Points in 3D (parametric form) P Q The parametric form of a line through two points, P ( x p , y p , z p ) and Q ( x q , y q , z q ) comes readily from the vector form of line (again a simple extension from 2D): Set base to point P Vector along line is ( x q - x p , y q - y p , z q - z p ) The equation of the line is: x = x p + ( x q - x p ) t y = y p + ( y q - y p ) t z = z p + ( z q - z p ) t As in 2D, t = 0 gives P and t = 1 gives Q Normalise if necessary.
Image of page 4
CM0268 MATLAB DSP GRAPHICS 1 519 JJ II J I Back Close Implicit Surfaces An implicit surface (just like implicit curves in 2D) of the form f ( x, y, z ) = 0 We simply add the extra z dimension . For example: A plane can be represented ax + by + cz + d = 0 A sphere can be represented as ( x - x c ) 2 + ( y - y c ) 2 + ( z - z c ) 2 - r 2 = 0 which is just the extension of the circle in 2D to 3D where the centre is now ( x c , y c , z c ) and the radius is r .
Image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
CM0268 MATLAB DSP GRAPHICS 1 520 JJ II J I Back Close Implicit Equation of a Plane ( a, b, c ) O d The plane equation: ax + by + cz + d = 0 Is normalised if a 2 + b 2 + c 2 = 1 . Like 2D the normal vector the surface normal — is given by a vector n = ( a, b, c ) a, b and c are the cosine angles which the normal makes with the x -, y - and z -axes respectively.
Image of page 6
CM0268 MATLAB DSP GRAPHICS 1 521 JJ II J I Back Close Parametric Equation of a Plane ( f 2 , g 2 , h 2 ) ( f 1 , g 1 , h 1 ) O ( x 0 , y 0 , z 0 ) x = x 0 + f 1 u + f 2 v y = y 0 + g 1 u + g 2 v z = z 0 + h 1 u + h 2 v This is an extension of parametric line into 3D where we now have two variable parameters u and v that vary. ( f 1 , g 1 , h 1 ) and ( f 2 , g 2 , h 2 ) are two different vectors parallel to the plane.
Image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
CM0268 MATLAB DSP GRAPHICS 1 522 JJ II J I Back Close Parametric Equation of a Plane (Cont.) ( f 2 , g 2 , h 2 ) ( f 1 , g 1 , h 1 ) O ( x 0 , y 0 , z 0 ) x = x 0 + f 1 u + f 2 v y = y 0 + g 1 u + g 2 v z = z 0 + h 1 u + h 2 v A point in the plane is found by adding proportion u of one vector to a proportion v of the other vector If the two vectors are have unit length and are perpendicular, then: f 2 1 + g 2 1 + h 2 1 = 1 f 2 2 + g 2 2 + h 2 2 = 1 f
Image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern