Homologous Traits
Certain types of large snakes, in particular boas and pythons, and cetaceans, whales and dolphins, are shown to have homologous hip bones, a pelvis and femur. These bones have previously been considered vestigial--organ or body part which became redundant through the course of evolution--, but upon further research, have shown to serve a purpose. These bones can be seen externally on snakes and are called spurs. They serve as a way to "hold on" to a female snake during copulation. Female snakes also have these bones, but are smaller in size. In particular, you can find these bones under a whale's blubber and just like snakes, exactly where legs would form. The pelvic bones of a whale have muscles attached to them from which the penis is able to move through. "Experts say the shape and size of a whale's pelvic bone influences how sexually attractive they are to females. They found that the bigger the testes, the bigger the cetacean’s pelvic bone." (source: http://www.dailymail.co.uk/sciencetech/article-2749561/Whale-sex-revealed-Useless-hips-bones-crucial-reproduction-size-really-matters-study-finds.html#ixzz3lOvx9tIK) Although these bones do not serve the same function as before, they adapted and are now both used analogously by these animals for copulation.
Around 300 Mya, a certain species of reptiles branched out and evolved into what are now snakes (reptiles) and whales (mammals). Hipbones were vital to these ancient ancestors as they needed to walk and perform other functions. As time progressed, based upon their environment and other factors, the need for those bones were no longer as necessary as before. Consequently, the bones shrunk and are know what we see in these animals.
“The most reasonable conclusion to draw is that these creatures descended from creatures, in which these parts were functional, which in turn indicates that most (or indeed all) creatures descended from common ancestors.”
—Natan Slifkin, The Challenge of Creation, page 262
Analogous Traits
The two different species that posses the analogous traits for dorsal fins are dolphins (cetaceans) and sharks (vertebrates). Although they share the same shape, they are more different than similar. The dorsal fins of both these species are the result of convergent evolution. Since dolphins and sharks faced similar environmental challenges, opportunities and pressures, they adapted and developed similar traits that were advantageous to them. Their streamlined bodies allow them to swim swiftly, making it easier to catch prey and escape predators.
Sharks evolved from fish and dolphins from mammals. The fins of dolphins and sharks are considered analogous traits because they evolved independently in different lineages. Although externally similar (streamlined), they differ anatomically in that dolphin's fins are not supported internally by cartilage, like that of a shark's fins, but are held erect by collagen fibers in the outside skin.