Compute distance of an atom from a specific point

Hi,

I want to know when a specific particle passes through a specific point. I was wondering how can I calculate the distance between a particle and another point.

thanks

You can use a per-atom variable for that.

Thanks for your answer.
How can I specify which atom I would like to suppose in my atom style variable?

Thanks for your answer.
How can I specify which atom I would like to suppose in my atom style
variable?

you cannot. they apply to all atoms.

axel.

you can use coordinates of that atom and your specific point coordinates and then use distance formula dis=sqrt(x1-x2)^2+…))

I am not sure how can I track the coordinates of an atom. Do you have any idea?

Thanks

get particle index from ovito. use variable to define distance. you just give particle index i in the x[i]. rest lammps will take care.