Need to map from cartesian R3 to a plane in R2

In summary, the student is attempting to solve a 3D rotation equation using standard algebra and converting from matrix form to standard. They are not sure how to find the angle for a given point, and are looking for help from an expert.
  • #1
Fox5
11
0

Homework Statement


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).


Homework 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)


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?
 
Physics news on Phys.org
  • #2
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
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.
 
  • #4
ok still unclear? you want to draw polygons on the plane that is defined by those 3 points?
 
  • #5
wait, I think I got you:
you want to rotate your coordinates so that your plane falls in x-y plane?
 
  • #6
rootX said:
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.
 
  • #7
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
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
 

1. How can I map from a 3-dimensional cartesian coordinate system to a 2-dimensional plane?

In order to map from cartesian R3 to a plane in R2, you will need to use a transformation matrix. This matrix will convert the 3-dimensional coordinates (x,y,z) to 2-dimensional coordinates (x,y) by eliminating one of the axes (usually the z-axis).

2. What is the purpose of mapping from cartesian R3 to a plane in R2?

Mapping from cartesian R3 to a plane in R2 can be useful for simplifying complex 3-dimensional data into a 2-dimensional representation that is easier to comprehend and analyze. It can also be used for various applications in computer graphics and engineering.

3. How do I determine the appropriate transformation matrix for my specific mapping?

The transformation matrix used for mapping from cartesian R3 to a plane in R2 will depend on the specific coordinate system and orientation of the plane. This matrix can be determined by analyzing the relationships between the coordinates in both systems and solving for the transformation equations.

4. Can I use a different method besides a transformation matrix for mapping from cartesian R3 to a plane in R2?

Yes, there are other methods for mapping from cartesian R3 to a plane in R2, such as using geometric projections or parametric equations. However, the transformation matrix method is the most common and efficient approach.

5. Are there any limitations or restrictions when mapping from cartesian R3 to a plane in R2?

The main limitation when mapping from cartesian R3 to a plane in R2 is that it can only represent a subset of the original 3-dimensional data. This is because one axis is eliminated during the mapping process, so some information is lost. Additionally, the transformation matrix method may not work for all types of 3-dimensional data, and other methods may need to be used in those cases.

Similar threads

  • Calculus and Beyond Homework Help
Replies
1
Views
1K
Replies
1
Views
138
  • Advanced Physics Homework Help
Replies
4
Views
418
  • Calculus and Beyond Homework Help
Replies
4
Views
1K
  • Differential Equations
Replies
11
Views
2K
  • Calculus and Beyond Homework Help
Replies
4
Views
1K
Replies
16
Views
1K
Replies
6
Views
965
  • Calculus and Beyond Homework Help
Replies
5
Views
1K
  • Calculus and Beyond Homework Help
Replies
17
Views
2K
Back
Top