Register to reply

Need to map from cartesian R3 to a plane in R2

by Fox5
Tags: cartesian, plane
Share this thread:
Fox5
#1
Apr21-08, 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 2-dimensional 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 2-dimensional 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 = |a||b|cos(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,y-y_i,z-z_i) and (x-x_i,1,z-z_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?
Phys.Org News Partner Science news on Phys.org
World's largest solar boat on Greek prehistoric mission
Google searches hold key to future market crashes
Mineral magic? Common mineral capable of making and breaking bonds
ice109
#2
Apr21-08, 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.
Fox5
#3
Apr21-08, 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 2-dimensional 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.

ice109
#4
Apr21-08, 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?
rootX
#5
Apr21-08, 08:21 PM
rootX's Avatar
P: 1,294
wait, I think I got you:
you want to rotate your coordinates so that your plane falls in x-y plane?
Fox5
#6
Apr21-08, 09:33 PM
P: 11
Quote Quote by rootX View Post
wait, I think I got you:
you want to rotate your coordinates so that your plane falls in x-y plane?
Right. I have an algorithm to draw in a 2-dimensional case, but need to find where points intersected by an arbitrary plane in 3 space would lie in 2 space.

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.
rootX
#7
Apr21-08, 09:41 PM
rootX's Avatar
P: 1,294
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
rootX
#8
Apr22-08, 12:22 AM
rootX's Avatar
P: 1,294
4) You have three vectors defining your rotated co-od , 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 Co-ordinates 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