The same calculation works in R^n, incidentally, using the geometric product. This is pretty much the ideal usecase for it, for constructing operators between vectors.
https://news.ycombinator.com/item?id=48619191
You probably know this, but this is one way to generalize beyond 2D