ComfyUI Node

Tangent

Tangent without the trig homework

By silveroxides·Created 2 months ago·Updated about 7 hours ago· 24
Tangent
  • angle
  • result
unitRadians

UC_MathTan computes the tangent of an angle, and the only interesting thing about it is the radian/degree toggle. If that sentence sounds dismissive, it's because this is a utility node in the strictest sense: you don't build workflows around it, you drop it into one when a formula somewhere needs a tan(). It's the Tangent entry in the trigonometry corner of silveroxides/ComfyUI-UtilsCollection, part of a clean math cluster that replaced the old ComfyUI-LogicMath nodes.

Where does tangent actually show up in a generation workflow? Almost always inside custom math for motion or scheduling. You might be mapping a sine wave into an easing curve, computing a camera sweep over frames, or building a lens-distortion-style parameter ramp - the sort of thing where you need tan and really don't want to hand-roll the trig into a Python script node when you're mid-experiment. It also pairs naturally with the pack's UC_MathSin and UC_MathCos, so you can build the whole trig family in the graph without reaching for a code node.

What's on the node

  • angle - the input. It's match-type, so int or float both work.
  • unit - a dropdown with Radians (default) or Degrees. This is the one setting you'll actually touch, and it exists because the classic beginner trap is feeding degrees into a function that expects radians and getting garbage out. Pick Degrees and the node converts for you.
  • result - a FLOAT output you can feed into any numeric input downstream.

Mechanically that's the entire story: the source converts to radians when needed and calls the standard tangent function. Nothing heavier, no models, no state.

Installing it

It comes with the pack, not standalone:

  • ComfyUI Manager: search "ComfyUI-UtilsCollection".
  • Or:
cd ComfyUI/custom_nodes
git clone https://github.com/silveroxides/ComfyUI-UtilsCollection

Restart ComfyUI after either. The pack's requirements are just opencv-python and typing-extensions. If you've got the standalone ComfyUI-LogicMath pack installed, expect ComfyUI to offer replacing those old math nodes with these - accept it and drop the old pack so you're not maintaining two sets.

Gotchas

Tangent has the one mathematical quirk everyone forgets: it's undefined at 90° (and 270°...), because the cosine in the denominator goes to zero. Feed it exactly 90 in Degrees and you'll get a very large or non-finite value depending on floating-point rounding. In practice, with the angle values people actually use in easing and motion math, you'll never land on it - but if you're driving this from a slider that can hit 90, be aware the curve blows up there. It's not a bug in the node; it's what tangent is.

The degree conversion is the feature to remember. Radians are the default because that's what the math library speaks, but "Degrees" is almost certainly what you want when you're thinking in angles you can visualize. Set it once and the node stops being something you think about at all.

Categoryutils/math/trigonometry

Inputs (2)

NameTypeDefaultDescription
angleCOMFY_MATCHTYPE_V3
unitCOMBORadians2 options: Radians, Degrees

Outputs (1)

NameTypeDescription
resultFLOAT