Searching for "node vector" orbital elements
leads me to this page, which gives pretty much the same system of equations in a different notation (bold instead of vector or hat markings):
We can find the vector $\boldsymbol n$ by taking the cross product of the angular momentum vector, $\boldsymbol h$, and the unit vector $\boldsymbol K $= <0, 0, 1>:
$$ \boldsymbol n = \boldsymbol K × \boldsymbol {h}$$
The convention in use here is that the spatial basis is defined by $\hat I$, $\hat J$, $\hat K$, being the unit vectors <1, 0, 0> <0, 1, 0> <0, 0, 1> respectively†. $\hat K$, the positive Z direction, is perpendicular to the equatorial plane of the primary body -- celestial north, in effect. Taking the cross product of $\hat K$ with the angular momentum vector $\vec h$ (which is perpendicular to the orbital plane of the satellite) yields $\hat n$, which is the node vector:
$\boldsymbol n$ is a unit vector on the line of nodes that points in the direction of the ascending node. The ascending node is the spot where the satellite crosses the equatorial plane in a northerly direction. Likewise, the descending node is the point where the satellite crosses the equatorial plane in the southerly direction.
In the equation
$$i=\cos^{-1}{\frac{h_K}{h}}$$
$h_K$ is just the K (i.e. +Z) component of $\vec h$. The corresponding line of pseudocode is i = acos(h(3)/mag(h))
-- h(3)
is indexing the third element of $\vec h$ (like it does in ~checks notes~ no programming language in mainstream use today).
The page I linked may have additional information useful to you.
† The great thing about notational conventions is that we have so many to choose from.