In reply to Ksharp.

Yes, exactly. And this coordinate-based approach is the one that you usually see. I think that the vector-based approach is more elegant and easier to construct from the geometry.