Prove that $\mathrm{SO}(n)$ is smooth and regular surface in the affine space of $n\times n$ matrices.
I was given the following definition of regular $k$-dimensional smooth surface: it is a smooth map $r:U\to \mathbb{R}^{n}$, $U\subset \mathbb{R}^{k}$, such that $\mathrm{rank}\left(\dfrac{\partial x^{i}}{\partial u^{j}}\right) = k$, where $x^{i}(i\in\overline{1,n}),u^{j}(j\in\overline{1,k})$ are basis vectors in $\mathbb{R}^{n}$ and $\mathbb{R}^{k}$ respectively.
I thought about considering maps like $f:\mathbb{R}^{n^2}\to \mathbb{R}^{n^2}$, sending $X$ to $X^{T}X$ or something like that, but constructing bijection $\psi$, in order to consider $\psi^{-1}$, obtaining needed $r$, but due to the fact, that I am new to this, I think I am missing something... How does one approach this problem, just knowing the definition above?