Trilobites are a group of extinct marine arthropods that first appeared around 521 million years ago, shortly after the beginning of the Cambrian period, and lived for nearly 300 million years until they died out at the end of the Permian period. They were very diverse for much of the Palaeozoic, and today trilobite fossils are found all over the world. Trilobites had a hard external skeleton, called a carapace, which is divided lengthwise into three lobes: a prominent central axis and two flatter lobes. The carapace consists of a head, or cephalon, which is typically crescent-shaped; a middle region called the thorax, made up of a number of overlapping segments; and a tail, or pygidium, in which the segments were fused. Trilobites had compound eyes, consisting of a number of separate lenses, and the number of lenses and the complexity of the eye structure varied enormously. Some trilobites had large, convex compound eyes with a large number of lenses, giving them a wide field of view forwards, backwards, sideways, upwards, and even downwards, depending on the actual curvature of the eye. Other trilobites had much smaller eyes, with fewer lenses, giving them a more restricted view. Trilobites occupied a variety of ecological niches, and some were probably detritus feeders, scavengers, or predators. The study of trilobite fossils has facilitated important contributions to biostratigraphy, paleontology, evolutionary biology, and plate tectonics.