Physics question...
Hello
I am trying to do a simple simulation of a Ball moveing over a surface like a pool game (WITHOUT Friction, so no rotation here), but the only difference with a pool table is that my table has slopes, so my trouble is as follows:
First I know that to program some real physics I need to calculate all the Forces acting over my ball''s center of mass
and then get the acceleration with a = F / m, so then I integrate this accel an get velocity so integrate then and I get my pos.
So for my ball rolling a Plane Table without slopes I use:
Fy = N - W = 0 (Where N = Normal Force, and W = mg)
Fx = F (Where F = Impulse force)
But when I am in a slope I know that I must get the Normal
and W components based in the slope angle, but I really dont know how to compute this with vector math?
I really appreciate any help with this.
Thanks
Oscar
I''m not completely sure I understood what you were asking, but I think your just looking for the normal to your angled plane? If you have the verteces of the plane (3 is all you need to define the plane), then create 2 vectors by subtracting 2 of them from one:
point a, b, c;
vector A, B;
A = a-b;
B - c-b;
Then use the cross product to get the normal to the plane:
vector normal = crossproduct(A, B);
the cross product of two vectors is the determinant of the following matrix.
|i, j, k |
|A1, A2, A3|
|B1, B2, B3|
where i j, and k are the basis vectors for 3D space.
i = <1, 0, 0>
j = <0, 1, 0>
k = <0, 0, 1>
The long and short is this:
normal = (A2*B3-B2*A3)i - (A1*B3 - B1*A3)j + (A1*B2 - B1*A2)k;
or in code
vector crossproduct(vector A, vector B)
{
vector normal;
result.x = A.y*b.z - b.y*A.z;
result.y = -A.x*B.z + B.x*A.z;
result.z = A.x*B.y - B.x*A.y;
return normal;
}
Sorry for being long winded. . .I hope this actually addresses your question
-Dan
point a, b, c;
vector A, B;
A = a-b;
B - c-b;
Then use the cross product to get the normal to the plane:
vector normal = crossproduct(A, B);
the cross product of two vectors is the determinant of the following matrix.
|i, j, k |
|A1, A2, A3|
|B1, B2, B3|
where i j, and k are the basis vectors for 3D space.
i = <1, 0, 0>
j = <0, 1, 0>
k = <0, 0, 1>
The long and short is this:
normal = (A2*B3-B2*A3)i - (A1*B3 - B1*A3)j + (A1*B2 - B1*A2)k;
or in code
vector crossproduct(vector A, vector B)
{
vector normal;
result.x = A.y*b.z - b.y*A.z;
result.y = -A.x*B.z + B.x*A.z;
result.z = A.x*B.y - B.x*A.y;
return normal;
}
Sorry for being long winded. . .I hope this actually addresses your question
-Dan
I''m not completely sure I understood what you were asking, but I think your just looking for the normal to your angled plane? If you have the verteces of the plane (3 is all you need to define the plane), then create 2 vectors by subtracting 2 of them from one:
point a, b, c;
vector A, B;
A = a-b;
B - c-b;
Then use the cross product to get the normal to the plane:
vector normal = crossproduct(A, B);
the cross product of two vectors is the determinant of the following matrix.
|i, j, k |
|A1, A2, A3|
|B1, B2, B3|
where i j, and k are the basis vectors for 3D space.
i = <1, 0, 0>
j = <0, 1, 0>
k = <0, 0, 1>
The long and short is this:
normal = (A2*B3-B2*A3)i - (A1*B3 - B1*A3)j + (A1*B2 - B1*A2)k;
or in code
vector crossproduct(vector A, vector B)
{
vector normal;
result.x = A.y*b.z - b.y*A.z;
result.y = -A.x*B.z + B.x*A.z;
result.z = A.x*B.y - B.x*A.y;
return normal;
}
Sorry for being long winded. . .I hope this actually addresses your question
-Dan
point a, b, c;
vector A, B;
A = a-b;
B - c-b;
Then use the cross product to get the normal to the plane:
vector normal = crossproduct(A, B);
the cross product of two vectors is the determinant of the following matrix.
|i, j, k |
|A1, A2, A3|
|B1, B2, B3|
where i j, and k are the basis vectors for 3D space.
i = <1, 0, 0>
j = <0, 1, 0>
k = <0, 0, 1>
The long and short is this:
normal = (A2*B3-B2*A3)i - (A1*B3 - B1*A3)j + (A1*B2 - B1*A2)k;
or in code
vector crossproduct(vector A, vector B)
{
vector normal;
result.x = A.y*b.z - b.y*A.z;
result.y = -A.x*B.z + B.x*A.z;
result.z = A.x*B.y - B.x*A.y;
return normal;
}
Sorry for being long winded. . .I hope this actually addresses your question
-Dan
Thanks for your replay, and unfortunatly I dont explain well
as Normal I refer to Normal Force which is the force applied by the plane over the rolling ball''s
Any way thanks for your help.
as Normal I refer to Normal Force which is the force applied by the plane over the rolling ball''s
Any way thanks for your help.
I think I know what you need to do,
the ball must always lie on the surface of the plane, we can use this restriction since this implies that the resultant force in a direction perpendicular to the plane must be 0. So, let n be the *unit* normal to the plane(make sure you get the right direction), and let N be the normal force vector that you are after, then we can find ||N|| from
||N||+F.n+(mg).n=0
and from this we have N=||N||n
where . denotes the dot/inner product, F is your external force (or sum of) and g is the gravity vector(which I assume would be 9.8<0,-1,0>).
From this the resultant force vector on the particle is the vector sum of all of N,F,mg, you can get the components in x&y direction from this easier than you can calculating them individually and composing them in to a vector.
JJ.
the ball must always lie on the surface of the plane, we can use this restriction since this implies that the resultant force in a direction perpendicular to the plane must be 0. So, let n be the *unit* normal to the plane(make sure you get the right direction), and let N be the normal force vector that you are after, then we can find ||N|| from
||N||+F.n+(mg).n=0
and from this we have N=||N||n
where . denotes the dot/inner product, F is your external force (or sum of) and g is the gravity vector(which I assume would be 9.8<0,-1,0>).
From this the resultant force vector on the particle is the vector sum of all of N,F,mg, you can get the components in x&y direction from this easier than you can calculating them individually and composing them in to a vector.
JJ.
Thanks for your help.
Well so to get my Normal Force (N) I need to use the following formula:N = F.n+(mg).n ?
Or could you tell me why do you refer to N as:
||N||+F.n+(mg).n=0
N=||N||n
Thanks in advance.
Oscar
Well so to get my Normal Force (N) I need to use the following formula:N = F.n+(mg).n ?
Or could you tell me why do you refer to N as:
||N||+F.n+(mg).n=0
N=||N||n
Thanks in advance.
Oscar
I''ve taken N to be a vector, you know that it''s in the direction of n, you just need to find it''s length, I''m using ||N|| to represent it''s length (which is the normal force in scalar terms).
The formula involving ||N|| comes from the fact that the component of F in the direction of n is F.n, likewise for the weight term. So your end formula for the normal force is ||N||=-F.n-(mg).n
and if you wanted it in vector form this gives you N=||N||n
Hope that clears things up, but remember I''ve assumed F and g to be vectors.
JJ.
The formula involving ||N|| comes from the fact that the component of F in the direction of n is F.n, likewise for the weight term. So your end formula for the normal force is ||N||=-F.n-(mg).n
and if you wanted it in vector form this gives you N=||N||n
Hope that clears things up, but remember I''ve assumed F and g to be vectors.
JJ.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement