A windmill is a mill that converts the energy of into rotational energy by means of vanes called sails or blades. Centuries ago, windmills usually were used to mill grain, pump water, or both. Thus they often weregristmills, windpumps, or both. The majority of modern windmills take the form of wind turbines used to generate , or windpumps used to pump water, either for or to extract .
The windwheel of the Greek engineer Heron of in the first century is the earliest known instance of using a wind-driven wheel to power a machine. Another early example of a wind-driven wheel was the wheel, which has been used in Tibet and China since the fourth century. It has been claimed that the emperor Hammurabi planned to use wind power for his ambitious irrigation project in the seventeenth century BCE.