The tangent law applies in two common contexts in physics and math, but from your wording it most likely refers to magnetism and the deflection of a magnetic needle.

Very short answer

Tangent law in magnetism applies when a magnetic needle is in two uniform, mutually perpendicular magnetic fields at the same time (for example, Earth’s horizontal field and a perpendicular field produced by a coil), and the needle comes to rest in equilibrium. In that situation, the fields satisfy

tan⁡θ=BBH\tan\theta =\frac{B}{B_H}tanθ=BH​B​

where BBB is the perpendicular applied field, BHB_HBH​ is the horizontal component of Earth’s field, and θ\theta θ is the steady deflection of the needle from the magnetic meridian.

When tangent law applies (magnetism)

Tangent law (in magnetism) applies under these conditions:

  1. Two fields present
    • One is the horizontal component of Earth’s magnetic field , usually denoted BHB_HBH​.
    • The other is a uniform magnetic field perpendicular to BHB_HBH​, typically produced by a current-carrying circular coil (tangent galvanometer or deflection magnetometer).
  2. Fields are mutually perpendicular
    • The field of the coil is at right angles to BHB_HBH​.
    • This “crossed fields” setup is essential; if they are not perpendicular, the simple tangent relation does not hold.
  1. Magnetic needle is freely suspended and in equilibrium
    • A small magnet/needle is pivoted so it can rotate freely in a horizontal plane.
    • It finally comes to rest at some angle θ\theta θ to the direction of BHB_HBH​; at this resting position, the torques due to both fields balance.
  1. Resulting relation (tangent law)
    Under these conditions,

B=BHtan⁡θB=B_H\tan\theta B=BH​tanθ

or equivalently

tan⁡θ=BBH.\tan\theta =\frac{B}{B_H}.tanθ=BH​B​.

This is called the tangent law , and it is the principle behind the deflection magnetometer and tangent galvanometer.

What it is used for

In practical experiments, tangent law is used to:

  • Measure an unknown magnetic field
    • If BHB_HBH​ is known and you measure the deflection θ\theta θ, you can get BBB using B=BHtan⁡θB=B_H\tan\theta B=BH​tanθ.
  • Determine Earth’s horizontal magnetic field
    • If the coil’s field BBB (from known current, radius, turns) is known, measure θ\theta θ and solve

BH=Btan⁡θ.B_H=\frac{B}{\tan\theta}.BH​=tanθB​.

  • Compare magnetic fields or magnetic moments
    • By seeing how the deflection changes when you change current or replace magnets/fields, you can compare intensities or magnetic moments.

Common confusion: law of tangents (triangles)

There is a separate law of tangents in trigonometry that relates sides and angles in an oblique triangle, often used when solving triangles with two sides and the included angle (SAS). It states, for sides a,ba,ba,b opposite angles A,BA,BA,B:

a−ba+b=tan⁡(A−B2)tan⁡(A+B2).\frac{a-b}{a+b}=\frac{\tan\left(\frac{A-B}{2}\right)}{\tan\left(\frac{A+B}{2}\right)}.a+ba−b​=tan(2A+B​)tan(2A−B​)​.

That applies when solving general (non‑right) triangles , not in magnetism. For your phrasing “tangent law applies when”, exam-style, the intended answer in physics courses is usually the magnetic version with two mutually perpendicular fields and a freely suspended needle.

Information gathered from public forums or data available on the internet and portrayed here.