
#1
Apr2108, 09:15 AM

P: 11

1. The problem statement, all variables and given/known data
This is actually a programming assignment, however it's very math involved. Given a set of points in R3 (x,y,z coordinates plus a weighted value) that are known to be coplanar, I need to draw an appropriately rotated, scaled, and colored plane intersecting the data. We know how to draw a plane in a 2dimensional case. We interpolate the data to create a new set of vertices evenly spaced and connect them using polygons until we have a filled grid. We set the 0 component to 0, and just increment in the x and y directions. What we need to know is how to determine where the points would lie on the 2dimensional plane (since they are coplanar) and how to either draw the plane in place or how to rotate it from along the coordinate axis into its proper location. We have no matrix math libraries, so all math needs to be broken down into standard algebra before we can implement (but I should be able to convert from matrix algebra to standard given the correct formula). 2. Relevant equations Set of coplanar points, (x,y,z). Can determine plane equation, aX+bY+cZ+d=0. Can get normal vector from this. Dot product: a (dot) b = abcos(theta) 3. The attempt at a solution Have attempted to use dot product with respect to normal vectors (1,0,0) and (0,1,0) to determine rotation axes. Also tried (1,yy_i,zz_i) and (xx_i,1,zz_i). These don't not appear to give the angles I'm looking for. The book had a derivation for a rotation about the origin in 2d that gives the transforms w_1 = xcos(theta)  ysin(theta) w_2 = xsin(theta) + ycos(theta) Using a similar derivation (possibly wrong) I arrived at in the 3 dimensional case (rho = p) w_1 = p (sin(phi_1)cos(phi_2)+cos(phi_1)sin(phi_2) )* (cos(theta_1)cos(theta_2)sin(theta_1)sin(theta_2)) w_2 = p (sin(phi_1)cos(phi_2)+cos(phi_1)sin(phi_2)) * (sin(theta_1)cos(theta_2)+cos(theta_1)sin(theta_2)) w_3 = p (cos(phi_1)cos(phi_2)sin(phi1)sin(phi_2) And assuming these are correct (derived from polar coordinate transformations and summing angles?), I would guess I substitute in for rho? I'm not sure what to substitute though, and I have no idea how to determine the angles. And after that, I suppose I'd solve for the w's in terms of x,y,z and then just leave one w = to 0 and increment through the other 2 to construct my plane? 



#2
Apr2108, 11:59 AM

P: 1,705

i don't understand what plane you need? because in your relevant equations you list the equation of a plane? does that mean you do know the plane that intersects three points? if not and that's what you need it's an easy problem.




#3
Apr2108, 04:11 PM

P: 11

I know the plane that intersects the three points, or rather it's defined by the 3 points.
What I want to do is construct and color a plane out of polygons, which is easy to do for a 2dimensional case but not an arbitrarily rotated 3d case. I need coordinate transforms from the generalized 3d coordinates to the rotated 2d plane so that I can construct a colored plane intersecting the data at any orientation. 



#4
Apr2108, 08:07 PM

P: 1,705

Need to map from cartesian R3 to a plane in R2
ok still unclear? you want to draw polygons on the plane that is defined by those 3 points?




#5
Apr2108, 08:21 PM

P: 1,295

wait, I think I got you:
you want to rotate your coordinates so that your plane falls in xy plane? 



#6
Apr2108, 09:33 PM

P: 11

So the steps are: 1. Define plane. 2. Find points that lie on plane. 3. Come up with transforms that make x, y, z dependent only on two variables x' and y'. (Z should drop out) 4. Use drawing algorithm to draw plane over x' and y', which should result in it being drawn correctly in 3 dimensions. Step 3 is what I'm not sure about. 



#7
Apr2108, 09:41 PM

P: 1,295

My Algorithm, if you have got you right:
1) Define Plane 2) Find two vectors that define that plane and are perpendicular (does not seem necessary) 3) take cross product (so you have three axis there  consider cross product as z axis) 4) .... ? I would come up with something But this is little different way to approach the problem so hopefully might give you some idea 



#8
Apr2208, 12:22 AM

P: 1,295

4) You have three vectors defining your rotated cood , and three unit vectors
<0 0 1> <0 1 0> <0 0 1> you can find theta, rhos from here using dot product... and you know the angles now! now, just check the validity of your proof (using any linear algebra book  too lazy to check it ><). http://www.kwon3d.com/theory/transform/rot.html 


Register to reply 
Related Discussions  
Proton hits infinite charged plane, find charge of plane  Introductory Physics Homework  1  
Cartesian product of cartesian products  Set Theory, Logic, Probability, Statistics  4  
Cartesian Coordinates of Plane Wave  Advanced Physics Homework  1  
what's wrong with the cartesian plane  Precalculus Mathematics Homework  3  
Vectors in the Plane: Plane+Wind question..  Precalculus Mathematics Homework  2 