A cam is a rotating or sliding piece in a mechanical linkage
Linkage generally means "the manner or style of being united", and can refer to:*Genetic linkage, the tendency of certain genes to be inherited together*Flux linkage, the total flux passing through a surface formed by a closed conducting loop...

 used especially in transforming rotary motion into linear motion or vice-versa. It is often a part of a rotating wheel
A wheel is a device that allows heavy objects to be moved easily through rotating on an axle through its center, facilitating movement or transportation while supporting a load, or performing labor in machines. Common examples found in transport applications. A wheel, together with an axle,...

 (e.g. an eccentric wheel) or shaft (e.g. a cylinder with an irregular shape) that strikes a lever
In physics, a lever is a rigid object that is used with an appropriate fulcrum or pivot point to either multiply the mechanical force that can be applied to another object or resistance force , or multiply the distance and speed at which the opposite end of the rigid object travels.This leverage...

 at one or more points on its circular path. The cam can be a simple tooth, as is used to deliver pulses of power to a steam hammer
Steam hammer
A steam hammer is a power-driven hammer used to shape forgings. It consists of a hammer-like piston located within a cylinder. The hammer is raised by the pressure of steam injected into the lower part of a cylinder and falls down with a force by removing the steam. Usually, the hammer is made to...

, for example, or an eccentric
Eccentric (mechanism)
In mechanical engineering, an eccentric is a circular disk solidly fixed to a rotating axle with its centre offset from that of the axle ....

 disc or other shape that produces a smooth reciprocating (back and forth) motion in the follower
Cam follower
A cam follower, also known as a track follower, is a specialized type of roller or needle bearing designed to follow cams. Cam followers come in a vast array of different configurations, however the most defining characteristic is how the cam follower mounts to its mating part; stud style cam...

, which is a lever making contact with the cam.
The cam can be seen as a device that translates from circular to reciprocating (or sometimes oscillating) motion.