Semi-invariants and their use for stability analysis of planar systems