Function fromHomogeneous

fromHomogeneous(q) takes a vector $q$ of length $n+1$, encoding a point in $n$-dimensional homogeneous coordinates, and returns a vector $p$ of length $n$, encoding the same point in Cartesian coordinates.