Word encompassing the words "above" and "below"?

The word "sideways" can encompass "left side" and "right side". Is there a word to encompass "above" and "below"?

• For what it's worth I don't think Sideways actually covers the provided use case. "The phone was on my left side" becomes "The phone was on my sideways". Beside is probably a better fit. In a case where sideways was the correct word, Vertically would probably fit for the above/below variant. Commented Oct 18, 2018 at 13:07
• What @Jontia said. Fish and birds routinely relocate vertically, but humans only normally move laterally (sideways), so we don't really have much need for such a term. Commented Oct 18, 2018 at 13:14
• @FumbleFingers: there's a group of 5 rectangles; one of the rectangles is in the center (let's call it "pivot") and the other rectangles attach to one of its edges. That means there is an "rectangle above", a "rectangle below", a "rectangle left" and a "rectangle right". The left and the right rectangles can be called "sideways rectangles"; how can the above and below rectangles be called in a single word?
– Dan
Commented Oct 18, 2018 at 13:20
• I agree with @Jontia that "sideways" doesn't necessarily cover your situation anyway. Why not 7 "cubes", rather than 5 "rectangles", in which case you'd also be looking for some word meaning movement backward/forward, as opposed to left/right? After all, real people are 3-dimensional, and it's often pretty much arbitrary which direction we call "forward" and which we call "leftward", for example. Commented Oct 18, 2018 at 13:34
• It's not my specialist subject, but you might find some relevant terminology in texts that reference X Y Z planes (but I don't even know which letters correspond to left/right, front/back, and top/bottom in that convention). Commented Oct 18, 2018 at 13:44

x-axis-neighbours (horizontal)

y-axis-neighbours (vertical)

I agree with the other comments, that I am not sure "sideways" serves the purpose you would like.

But if you are not trying to exclude to the left or right, I would say "the surrounding area" or "the surroundings", as this would encompass anything in the vicinity of the object of interest.

Otherwise, I do not know of a word specifically for above or below, but not to the side, unless you want to be more technical and say "along the vertical axis of" or something of that sort which is less concise though than saying above or below.

To fit your algorithm, I would say that 'vertical rectangles' would fit your needs best, as Jontia suggested. If that doesn't work, you could use FumbleFingers' suggestion and term the groups 'X Rectangles' and 'Y/Z Rectangles' (either would be correct in a 2D space). If you need them in opposing groups of two, that would definitely work.

If neither of these options work, let me know why. I might be able to edit in a better suggestion.