How to translate an equation from 2D to 3D for collision response?

  • Thread starter Nils Schneider
  • Start date
  • Tags
    2d 3d
In summary, Nils Schneider is asking for help translating a 2D equation into code for 3D vectors. He is concerned that he may be doing something wrong with the current equation. Another member, Jim, explains the difference between 2D and 3D vector products and provides some real-life examples.
  • #1
Nils Schneider
Hello members,

I'm working on collision response at the moment. I have some good documents here but they are only for 2D. Can someone translate me this http://www.nilsschneider.de/temp/eq.jpg equation into code that works for 3D vectors as well? I fear that I'm doing something wrong here:

w2A = w1A + ( rAP x (j * n) ) / iA

Many thanks in advance.

Neels
 
Physics news on Phys.org
  • #2
Originally posted by Nils Schneider
Hello members,

I'm working on collision response at the moment. I have some good documents here but they are only for 2D. Can someone translate me this http://www.nilsschneider.de/temp/eq.jpg equation into code that works for 3D vectors as well? I fear that I'm doing something wrong here:

w2A = w1A + ( rAP x (j * n) ) / iA

Many thanks in advance.

Neels

Hi Neels,
Off-hand it seems that you are not familiar with the difference between 2D - "vector dot product" and 3D - "vector cross product".
In 2D the trig nature (diagonal of parallelogram)implies that the labeling, as a product, hides the reality that the resultant is the scalar "sum" of the geometric aspects of the co-acting scalars.
On the other hand, physicists usually speak in non-math terminolgy to discuss 3D mechanics; e.g. they will use terms like: "right-hand rule" when referring to the obvious 3D phenomena apparent with dipolar things like torque and magnetism. You'll note that it's difficult to warp the two fingers and thumb of your right hand such that the angles between the pseudo-vectors are exactly perpendicular. This is where the "cross-product" treatment makes the magnitude of the 3D vector calculable: the rule is to join the xy vectors at the xy origin and determine the magnitude of the z-directed vector (from the xyz origin) that is the product of the magnitudes of the two xy vectors. Real life examples of 3D vector behavior are the electromagnet and the gyroscopic top. Cheers, Jim
 
Last edited:

1. What is the difference between a 2D and 3D equation?

A 2D equation is a mathematical expression that describes a relationship between two variables on a flat surface, such as a graph or coordinate plane. A 3D equation, on the other hand, describes a relationship between three variables in a three-dimensional space, such as a cube or sphere.

2. How do I convert a 2D equation to a 3D equation?

To convert a 2D equation to a 3D equation, you will need to add an additional variable to represent the third dimension. This could be a variable such as z or w. You will also need to adjust the coefficients and exponents in the equation to account for the extra variable.

3. Can any 2D equation be converted to a 3D equation?

No, not all 2D equations can be converted to 3D equations. Only equations that have a relationship between three variables can be expressed in 3D form. For example, a simple equation like y = 2x + 1 cannot be converted as it only has two variables, while an equation like z = x^2 + y^2 can be converted to a 3D equation.

4. What is the purpose of converting an equation from 2D to 3D?

Converting an equation from 2D to 3D allows us to visualize a mathematical relationship in a three-dimensional space. This can help us better understand the behavior and patterns of the variables involved. It is also useful in many fields such as physics, engineering, and computer graphics.

5. Are there any limitations to converting an equation from 2D to 3D?

Yes, there are some limitations to converting an equation from 2D to 3D. For example, certain equations may not have a meaningful interpretation in 3D space or may become too complex to be useful. Additionally, the process of converting an equation can be subjective and may depend on the purpose or perspective of the person doing the conversion.

Similar threads

Replies
7
Views
6K
  • Introductory Physics Homework Help
Replies
10
Views
847
  • Quantum Physics
Replies
6
Views
2K
Replies
3
Views
842
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Astronomy and Astrophysics
Replies
7
Views
4K
Replies
6
Views
2K
  • Mechanics
Replies
1
Views
4K
  • Mechanical Engineering
Replies
1
Views
3K
  • Programming and Computer Science
Replies
18
Views
1K
Back
Top