Cassiopeia was the wife of king Cepheus of Ethiopia. She claimed that her daughter, Andromeda, was more beautiful than the Nereids - sea-nymph daughters of Neptune , the granddaughters of Oceanus and Tethys.
People talk, as they do, and the Nereids were not exactly happy to hear that a mere mortal was better looking, so they complained to their father and he sent a sea monster, Cetus, to ravish Ethiopia.
Poor king Cepheus consulted the oracle of Ammon and discovered that the only way to save his kingdom was to feed his daughter to the monster. Faced with such a tough choice - his daughter or his kingdom - he promptly chained her to a rock to await her fate.
Meanwhile, Perseus was passing overhead on Pegasus, the winged horse, homewards bound having just lopped off the head of the Gorgon Medusa. Spying the beauty below him, he landed and struck a deal with king Cepheus - Andromeda's hand in marriage for the destruction of Cetus. King Cepheus agreed, so Perseus took off, flew over Cetus and whipped out Medusa's head.
Cetus was instantly turned to stone. Perseus landed to claim his bride, but had to deal with a little trouble in the form of Andromeda's uncle Agenor - to whom she was betrothed. Perseus, being a decent sort of chap, turned Agenor's army to stone. He and Andromeda then took off into the sunset where they married and had several sons.
Cassiopeia was placed in the sky in the undignified pose of on her back, feet upwards. Cepheus, Perseus, Pegasus and Andromeda were placed next to her. Perseus is holding the Gorgon Medusa's head - her twinkling eye is supposed to be the star Algol.