A tangent is an entirely different topic or direction. When you want a break from geometry class, you might ask your teacher about his hobby of woodworking, a topic that's always good for a tenminute tangent.
Tangent is mainly a mathematical term, meaning a line or plane that touches a curved surface but doesn't intersect it. The nonmathematical meaning of tangent comes from this sense of barely touching something: when a conversation heads off on a tangent, it's hard to see how or why it came up. When talking about history, someone suddenly brings last night's basketball game? Definitely a tangent.
Definitions of tangent
1
n a straight line or plane that touches a curve or curved surface at a point but does not intersect it at that point
 Type of:

straight line
a line traced by a point traveling in a constant direction; a line of zero curvature
n ratio of the opposite to the adjacent side of a rightangled triangle
 Synonyms:
 tan
 Type of:

circular function, trigonometric function
function of an angle expressed as a ratio of the length of the sides of rightangled triangle containing the angle