3D in Geogebra – the plane through 3 points Paul Robinson, IT Tallaght Websites Geogebra Homepage: http://www.geogebra.org/cms/ Use the Appletstart Version of Geogebra or download a stand alone version. Geogebra Forum: http://www.geogebra.org/forum/ Community of Geogebra users, bug reports and feature requests Geogebra Facebook Group: http://www.facebook.com/home.php#!/geogebra Pretty active, conference news, lots of helpful stuff Geogebra Wiki: http://www.geogebra.org/en/wiki/index.php/English Collection of re-usable teaching resources University of Limerick: http://www.ul.ie/cemtl/resources.htm Excellent GeoGebra step by step demos – Math 247: http://math247.pbworks.com/Learn-and-Use-GeoGebra Fantastic Step-by-Step Help on How to Use GeoGebra by Dr Linda FahlbergStojanovska. Includes accessing Geogebra properties and methods using Javascript very cool. LaTeX online equation editor: http://www.numberempire.com/texequationeditor/equationeditor.php Indispensible if you want to put mathematics into Moodle and don’t know any LaTex! Introduction Geogebra can do a pretty good job of representing 3D objects, allowing rotations and dilations to view things from different angles and to zoom in. These notes are based on a construction by Michele Passante (http://www.mateblog.it/?p=372). px First a bit of theory: Let P py be a point in 3D space. The 3D rotation matrices about p z the x, y and z axis are 0 0 1 Rx 0 cos(a) sin(a) 0 sin(a) cos(a) cos(b) 0 sin(b) Ry 0 1 0 sin(b) 0 cos(b) cos(c) sin(c) 0 Rz sin(c) cos(c) 0 0 0 1 where a, b and c are angles between 0o and 360o. The rotation RX will rotate P in the horizontal plane anticlockwise about the vertical z axis through an angle of a, and similarly for Ry and Rz. If we rotate P and the x, y, z coordinate frame using R we can interpret the result as a rotated view of the original point P. This is what we will do in the construction which follows. We will write a general rotation as R Rz Ry Rx , which will allow us to rotate about the 3 axes. Note that the 3 rotations do not commute with each other, meaning that if we write them in a different order the result will generally be slightly different! This will not matter in terms of using rotations to view 3D objects. qx After rotation the point P will have 3D coordinate RP qy q z where the q coordinates now depend on the angles a, b and c. To see what this looks like in 2D (on the screen!) we simply want two of the coordinates of RP. If we imagine the x axis pointing out of the screen towards us then the screen coordinates are y, z. This qy means we need to plot the point Q . qz This construction is OK, but it is not very flexible. As well as Q we will want to extract some other information from the 3D point RP, and it is not easy to do in GeoGebra with RP in this form. Instead we will start with px 1 0 0 P py p x 0 py 1 p z 0 p x E x p y E y p z E z 0 0 1 p z Now RP px RE x py RE y pz RE z . We can now think of px as the component of the rotated P in the direction of the rotated axis RE x . If we let Wx be the 2D vector with components the y and z coordinates of REx , and similarly for Wy and Wz then we have Q pxWx pyWy pzWz The vectors pxWx , pyWy and pzWz are the components of the rotated P along the rotated axis as viewed on the screen. We will construct the rotation of a 3D point P with its axis frame. The point P does not change its position, just our rotated view of it changes. Creating a 3D axis frame 1. Put on sliders for angles a, b, c and another named d which will be used to lengthen and shorten our axes: Click on the slider tool then on the drawing pad. Call it a and select the angle option. Go with the default of 0o to 360o. Repeat for sliders b and c. Create another slider called d with a Number value from 0.5 to 5 in steps of 0.1. Right click the sliders (or their values in the left hand window) if you want to change their properties. click on the object selection tool if you want to move the sliders around. 2. Put in unit vectors along the x, y and z axes. In the input line at the bottom of the screen type E_x = {{1}, {0}, {0}} press return 1 This represents the column vector E x 0 . A row of numbers would be written as 0 {1, 0, 0}. We need a column as we want to multiply by a matrix. Repeat the input for E_y = {{0}, {1}, {0}} and E_z = {{0}, {0}, {1}} 3. Put in the rotation matrices Rx, Ry and Rz and the dilation matrix D In the input line type R_x = {{1, 0, 0}, {0, cos(a), -sin(a)}, {0, sin(a), cos(a)}} R_y = {{cos(b), 0, -sin(b)}, {0, 1, 0}, {sin(b), 0, cos(b)}} R_z = {{cos(c), -sin(c), 0}, {sin(c), cos(c), 0}, {0, 0, 1}} press return press return press return For the general rotation type R = R_z*R_y*R_x 4. Create our axes In the input line type V_x = R*E_x press return press return This will rotate (and dilate) the unit vector E_x which is pointing along the x-axis. Repeat for V_y = R*E_y and V_z = R*E_z Now we need to see what that looks like on the screen. The vectors V_x, V_y and V_z are column vectors. As mentioned in the introduction we want the 2nd and 3rd components of our 3D vectors to create a point on the screen. This is probably a good point to turn off labeling. Go to Options, labeling and click on No New Objects. In the input line type W_x = (Element[Element[V_x,2],1], Element[Element[V_x,3],1]) and press return. Element[V_x,2] is the second number in V_x, which is itself a list { } consisting of 1 number. We want the “first” number in that list. The round brackets in W_x mean that we now have a point in 2D which you should see on the screen. Repeat for W_y = (Element[Element[V_y,2],1], Element[Element[V_y,3],1]) W_z = (Element[Element[V_z,2],1], Element[Element[V_z,3],1]) In the input line type u = vector[d*W_x] press return Repeat for v = vector[d*W_y] and w = vector[d*W_z]. Hide the points W_x, W_y and W_z by clicking on the circles next to their definition in the left hand window. Click on the object Selection Tool then move sliders a and b to 30o, followed by moving c. See that d makes things bigger and smaller. 5. Make the axes look a bit nicer. Go to View and click on Axes to remove the default GeoGebra axes. Right click on the u vector (do it in the definition in the left hand window) and go to Properties at the bottom of the list. Use ctrl or shift to select u, v and w in the vector list simultaneously. Set the Colour to dark blue and the Style line thickness to 5. In the input line type –u and press return. Do the same for –v and –w. Select these 3 new vectors as before, leave the colour on black and the line thickness as thin but change the line style to fine dots. We also need to label our axes. Click on the small arrow at the bottom of the Slider Tool and select the Insert Text option. Click on the screen anywhere and type X for the text. Now right click the X text, go to Properties and Position. In the Starting Point box type 2*W_x. You may use the mouse to move the X text slightly but as you move the slider controls a, b, c and d it should follow the arrow head of the x-axis. Repeat this text insert for Y (Starting position 2*W_y) and Z (Starting position 2*W_z). As a final flourish type Polygon[d*(W_x+W_y), d*(-W_x+W_y), d*(-W_x-W_y), d*(W_x-W_y)] And press return. Right click each side of this polygon and click off Show Object. Use the Panning Tool (click it then drag on the screen) if you want to centre your construction a little. Click the little arrow on the panning tool to bring up the Zoom In and Zoom Out Tools (click then click the screen) if you want your picture bigger or smaller. We can now put other objects on our axes frame like points, lines and planes and see what they look like in 3D. We can also make geometric objects e.g. a cube made up of corners (points) and faces (polygons). The Plane through 3 points Creating constructions which require several points is most efficiently done using GeoGebra’s spreadsheet capability. We will construct the plane through (2, 0, 0), (0, 3, 0), (0, 0, 6) which has the equation 3x 2y z 6 In GeoGebra go to View, Spreadsheet View and also click off Algebra View. Use the Panning Tool to move your axes if required. Type this, Each row is a point on our plane. If you want to see a different plane through 3 other points simply change these numbers. As discussed in the introduction a point P with coordinates px, py, pz will have the screen coordinate Q pxWx pyWy pzWz . In the input line type D2=A2*W_x+B2*W_y+C2*W_z Click on cell D2. Click and hold the mouse on the small blue square in the bottom right hand corner of D2 (the fill handle) then drag down to cell D4. You should see 3 points on your coordinate axes. You may need to make the dilation value d smaller to see them all! In the input line type Polygon[D2, D3, D4] Which is a triangular section of our plane through the 3 points. A vector equation of the plane If P1, P2 and P3 are 3 points defining a plane then P2 – P1 and P3 – P1 are vectors from the origin lying parallel to the surface of the plane. If s and t are numbers then r P1 s(P2 P1) t(P3 P1) is a vector from the origin to the plane for every s and t value (what s and t values correspond to being at P1, P2 or P3?). The point r then describes the plane. Put sliders on the screen named s and t with values from -5 to 5. In the input line type vector[D3-D2] press return vector[D4-D2] press return Rotate your figure to see that these vectors are parallel to the plane. Colour them red so that they stand out. In the input line type r = vector[D2 + s*(D3-D2)+t*(D4-D2)] press return Move the s and t sliders together with rotating the figure to see that r really does describe a point on the plane! Problems 1. Delete the t slider, the vector r and the vectors vector[D3-D2] and vector[D4-D2]. The point P2 s(P2 P1) is P2 when s = 0 and is a point on the line from P2 in the direction from P1 to P2 when t is greater than 0. Plot the point D3 + s*(D3 – D2) to see this by moving the slider s. Can you use this idea with the polygon command to create a larger triangle than the original one as s increases? 2. A vector normal to the plane through the points P1, P2 and P3 is given by n P2 P1 (P3 P) 1 where × means cross product. Display n on your 3D axes. 3. If P1 and P2 are two points with GeoGebra representations Q1 and Q2 then the line through Q1 and Q2 is Line[Q1 , Q2] Create a line on your axes which intersects the original plane. Can you produce a line normal to the plane which goes through P 2? Can you produce a vector from the origin which finishes on the line and is controlled by a slider value to move along the line?