- #1

Xyius

- 508

- 4

I am writing a simulation in MATLAB of particles that perfectly reflect off of a surface. However, my question is physics based, not code based.

So here is my issue. A particle is traveling towards a flat plane in space at z=1 with a velocity vector of [0,0,1]. The normal vector of the surface is [0,0,-1].

I want to calculate the reflected trajectory of the particle so I use the following expression.

[tex]|\vec{v}|\left[2(\hat{n} \cdot \hat{v})\hat{n}-\hat{v}\right][/tex]

The problem is, in my head, the reflected trajectory should clearly be [0,0,-1] However, when I calculate it, I get [0,0,1]. Why is this happening? Is my equation right?

EDIT:

I know the normal vector of the surface is correct, as the front of the plane is facing the particle source.

Also, I need to use the general expression for a reflection as I will be moving onto any 3D object as the next step.

So here is my issue. A particle is traveling towards a flat plane in space at z=1 with a velocity vector of [0,0,1]. The normal vector of the surface is [0,0,-1].

I want to calculate the reflected trajectory of the particle so I use the following expression.

[tex]|\vec{v}|\left[2(\hat{n} \cdot \hat{v})\hat{n}-\hat{v}\right][/tex]

The problem is, in my head, the reflected trajectory should clearly be [0,0,-1] However, when I calculate it, I get [0,0,1]. Why is this happening? Is my equation right?

EDIT:

I know the normal vector of the surface is correct, as the front of the plane is facing the particle source.

Also, I need to use the general expression for a reflection as I will be moving onto any 3D object as the next step.

Last edited: