* Igneous rocks form from the cooling and solidification of molten rock (magma or lava). Crystals can form within igneous rocks as the molten material cools and minerals solidify.
* Sedimentary rocks form from the accumulation and cementation of sediments (fragments of other rocks, minerals, or organic matter). Crystals can be present in sedimentary rocks if they were present in the original sediment or formed during the rock's formation.
* Metamorphic rocks form when existing rocks (igneous, sedimentary, or even other metamorphic rocks) are transformed by heat, pressure, or chemical reactions. Crystals can form or change within metamorphic rocks as a result of these processes.
In summary:
* Crystals are components of rocks, not a rock type themselves.
* The type of rock (igneous, sedimentary, or metamorphic) determines how the crystals formed and their characteristics.