[Solved] Transform 3D Cross Vec to 2D Cross Vec

Started by
5 comments, last by Finalspace 9 years, 2 months ago

I have a cross product function in a paper like this:

F = N x W - where V are a 3D Vector as result (later used as an addition to another vector)

How do i handle this type in 2D?

Using zero as Z-value for a normal 3D Cross operations results in a (0, 0, z) vector - therefore this does not work.

If one component was a scalar instead of a vector, i could just compute the perpendicular scaled by the scalar to achieve the same result.

Thanks,

Final

Advertisement

Using zero as Z-value for a normal 3D Cross operations results in a (0, 0, z) vector- therefore this does not work.

Actually, your result is correct. A 3D cross-product results in a vector orthogonal to both input vectors, with a length proportional to the rhomboid area formed by the two input vectors.

So, the cross-product of 2 vectors in the X-Y plane is a vector orthogonal to that plane (i.e., along the z-axis,) with a length = rhomboid area formed by the two input vectors. In this case, z = length = area.


How do i handle this type in 2D?

Not sure what "type" means in that context. Can describe what you want to do, rather than how you want to do it? For instance, are you looking for an area? Otherwise, determining a 2D vector orthogonal to both of 2 2D vectors doesn't make sense mathematically.

EDIT: If you want to, you could define a 2D cross product as (v0.x*v1.y-v0.y*v1.x), which would be a quasi-2D-analog of the 3D mathematical result of 2 3D vectors, both with z = 0.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

Well that paper does not explain what these cross product are really do, its just required in the formula...

pbf_vc.jpg

In preudo-code this formulas looks like this:


w_i = (0,0,0)
for (all neighbors of i) {
    v_ij = vj - vi;
    gradient = W(pi, pj);
    w_i += cross(v_ij, gradient);
}

N = (0,0,0)
for (all neighbors of i) {
    N += W(pi, pj) * magnitude(w_i);
}
N = normalize(N);

fi_vorticity = e * cross(N, w_i)

But how does this translate in 2D?

IMHO (not being a mathematician or physician, so I may be wrong), the formulas can be used "as is", i.e. go with the 3rd co-ordinate. That omega appears to me similar to an angular velocity, and in 2D its plane of rotation would naturally have the normal (0,0,z). If I interpret the both formulas correctly, then the correcting force f will be "back in 2D" again, because of the 2nd usage of a cross-product with the said omega as argument, so that the result can be applied in 2D world.


how does this translate in 2D?

It's still not clear what you want to do.That is, assuming you don't mean "translate" as a term for displacement, "translate" is not a mathematical term in the above context, because it's more than just the math. It appears that the paper also involves physics and behavior in 3D.

So, if you're interested in modeling the 3D fluid dynamics described in 2D, there would be more to that than, for instance, changing 3D vectors to 2D, or setting z=0 everywhere. As mentioned, it's likely that, in the paper you're studying, there are assumptions about the laws of physics, boundary conditions, motion constraints, etc., that you would have to redefine for a 2D case, to ensure the results remain in a plane. Even then, you'll have to decide if you're interested in just adding constraints to the 3D world to confine behavior to 2D, or whether you want to model a true 2D world of some sort.

Again, if you're interested in 2D fluid dynamics, you may want to google for "fluid dynamics 2D" or the like.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

I don't know what vorticity is so I can not really understand your equation (e.g. in what space is your problem defined? what does pi mean? Does wi stand for weight?...).

I am wondering does it ever make sense to translate this into 2D?

- Does Vorticity make sense in 2D?

- In 3D, a cross product produces another vector while in 2D a cross product produces a scaler. However, if wi means some kind of weight in a direction, then in 2D you should be able to do something similar with tangent.

I implemented the math in 3D for the cross products with zero as z-component and it worked just fine :-)

Thanks for the answers.

Thread can be closed.

This topic is closed to new replies.

Advertisement