I have a coarse-grain molecular dynamic performed in Gromacs. I am interested, in computing the distance between an atom (bead) and a group of atoms (beads), that we can see as a plane.
I think that it strongly depends on if you want the distance from the plane defined by those atoms or just the distance from those atoms.
If you have a group and want to calculate the distance from another group, then if you build properly the corresponding indexes you can use the suggestion made by Ricardo J Ferreira .
However, if you are speaking about the minimum distance of an atom from the plane defined by another group, I am not sure you can do that with GROMACS. For example, lets say you have three atoms A, B and C at positions
A = (0, 0, 0)
B = (1, 0, 0)
C = (0, 1, 0)
and your atom D is at position (1, 1, 1).
The atoms A, B and C define the xy plane, that is the plane orthogonal to z and passing through z = 0. With respect to this plane, the minimum distance of your atom D is 1 (trivially, its z component). In this case you used the three atoms to define a plane, and computed the minimum distance of D from that plane.
On the other hand, the distance of your D atom from the group defined by the {A, B, C} atoms is another thing. For example, the minimum distance of D from any atom in that group is sqrt(2), which is the distance of D from both B and C.
This is in addition to Ricardo's answer. After you create your groups using 'gmx make_ndx', use 'gmx distance' with the -oxyz flag. This will output 4 columns: time and distance along X, Y, Z axes. Select/plot the column corresponding to the axis that is perpendicular to your plane (group of atoms). Assuming your plane of atoms constitutes the surface of a membrane which is parallel to XY axes, you'll need to select the values from the Z axis column.
Following Vladimir's comment on having an alternative way of calculating this, you can also use VMD Tk Console - make two selections and calculate distance between their center of masses per frame. I'm not sure if it can calculate along a particular axis. For help with VMD scripting and analyses, you can follow this YouTube channel: https://www.youtube.com/watch?v=BLPvn0_aRiE by Mohamed Shehata