In a book I've been reading (focused on combinatorial optimization), the following definition is given
The dimension $\text{dim} \; X$ of a non empty subset $X \in \mathbb{R}^2$ is defined to be $$ n - \max \left\{rank(A) : A \in \mathbb{R}^{n \times n}, Ax = Ay \; \forall x,y \in X\right\} $$
I've a lack of intuition of what geometrically this means so I've tried a simple case.
Consider $n = 2$, $r > 0$ and $X = \left\{(x,y) \in \mathbb{R}^2 : \sqrt{x^2 + y^2} < r \right\}$
What's the dimension in this case?
I've tried to compute it by myself, but I wasn't neither able to set up the problem. The fact that it has to be $Ax = Ay$ for all $x,y \in X$ implies that $A(x-y) = 0$, so I would suspect is related to some kernel dimension of a linear transformation, however I'm sure that explicitly stating that $Ax = Ay$ must mean something more than that. Any hints of both what the dimension in this context means and how to compute my specific case?
Snippet from the book I'm reading through

As already noted in the comments, this notion of dimension is only usefull for convex bodies. I left as an exercise to you, but it should not be difficult to prove that, with the given definition, $\dim\,X$ is the dimension of the smallest affine subspace of $\mathbb{R}^n$ containing $X$.
For an example, in which this definition fails, consider the non-convex set $C:=\{(x,y)\,|\,x^2+y^2=1\}$ for which the dimension of the smallest affine subspace containing it is $2$ as it is not contained in any line and so $\dim\,C=2$ according to the above definition although we don't expec to define the dimension of a circle as $2$.