Tangent
The trig node for transitions, and the one to be careful with
- angle
- result
Sine and cosine get all the love in animation workflows, but tangent is the trigonometry node for when you want something to snap, not glide. Its curve ramps gently, then steepens dramatically as it approaches a vertical asymptote. That shape is perfect for a quick-then-slow transition, and also for generating numbers that surprise you if you don't know what you're in for.
It ships in silveroxides/ComfyUI-LogicMath, the pack whose one-line README reads "Logic operators and Math nodes based on a PR that never got merged." Same author maintains the Chroma-GGUF quant pack. MathTan, like the rest of the pack, is V3-native - it registers through ComfyUI's newer extension API (comfy_api.latest) with no legacy NODE_CLASS_MAPPINGS, so it runs on current ComfyUI and nowhere else.
How it works
MathTan wraps Python's math.tan(). Feed it an angle, get the tangent back as a FLOAT. The unit dropdown handles the same choice as its siblings:
- Radians (default) - raw
math.tan(). - Degrees - converts to radians first, so
tan(45)returns 1 as expected.
The behavior that matters is the asymptote. Unlike sine and cosine, which stay safely between -1 and 1, tangent shoots toward positive and negative infinity as the angle approaches 90° (or π/2). At exactly 90° Python doesn't error out - it hands you a huge float like 1.6e16 - and that gigantic number can poison whatever you feed it downstream. If you're animating with tangent, clamp the result or stay clear of the asymptote, or your "smooth transition" becomes an explosion.
In practice, tangent's useful trick is that gentle-rise-then-vertical shape: take a value that's creeping from 0 toward the asymptote and you get a transition that starts slow and finishes with a snap. Keep it away from the wall and it's a legitimate easing curve.
Inputs and outputs that matter
angle- an int or float. Feed a progress value or frame counter, but be mindful of where the curve goes vertical.unit- Radians or Degrees. Default is Radians; flip it if you think in degrees.result(FLOAT) - the tangent of the angle. Unbounded, and that's the gotcha.
Installing it
ComfyUI Manager is the fast path: Manager → Install Custom Nodes → search "ComfyUI-LogicMath". Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/silveroxides/ComfyUI-LogicMath
Restart ComfyUI. No model downloads, no requirements.txt - the only dependency is comfy_api, which ships with modern ComfyUI.
Common gotchas
- Tangent is unbounded. Sine and cosine never leave -1 to 1; tangent lives outside it. A
tan()result in the millions isn't a bug, it's the math being honest about the asymptote. - Radians vs Degrees - default is Radians, so "90 degrees" thinking will bite you. Set the dropdown or convert.
- V3-only. Old ComfyUI won't register this pack at all. If the node is missing after install, update ComfyUI, then reload.
- Float output. The result is always FLOAT, so INT-strict inputs downstream need MathNumberConvert or MathRound in between.
Tangent is the trigonometry node you'll use once in a while, deliberately - the sibling to MathSin and MathCos that earns its keep when you specifically want a steep, accelerating transition instead of a smooth wave.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| angle | COMFY_MATCHTYPE_V3 | — | |
| unit | COMBO | Radians | 2 options: Radians, Degrees |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| result | FLOAT | — |