You may think of the two lines representing the double bond like the bird's eye view on a door of a saloon: If the two wings, the one on the left of the double bond, and the one of right flap in the same direction, then the double bond is in cis-configuration. On the contrary, if the two flap in opposing directions, than the double bond is in trans-configuration.
For future reference -- taking into account the third picture shown by you -- cis and trans may be ambiguous; and triple and quadruple substituted double bonds' configuration are described only with E- or Z-configuration (cf. here). Eventually, as correctly pointed by @Zhe, in your last example, the double bond is neither E-, nor Z-configurated.