Pt Asin
Arcsin, the half of the trig pair nobody shows off
- tens_a
- TENSOR
Pt Asin is the inverse of the sine function, as a node: feed it a sine value and get back the angle in radians. It's the quieter sibling of Pt Acos in ComfyUI-Pt-Wrapper's trig shelf, and like its sibling, it's a tool you'll want maybe once per real project - but when the need is real, it's exact.
This is one of the single-argument math wrappers in HowToSD's 200-node PyTorch pack (the spin-off of ComfyUI-Data-Analysis). The realistic use cases in tensor land: recovering angles from sine-of-angle measurements (rotation estimation, signal phase work), inverse trig inside custom activation or normalization math, and error metrics that express differences as angles. It's also part of the toolkit if you're building unusual loss functions where a component is naturally sine-valued.
How it works. One input, tens_a; one output, TENSOR. Element-wise asin(), radians out, same shape, no settings.
The domain warning applies here too - and it bites people more than Acos does. Arcsin is only real for inputs in [−1, 1]. Sine values outside that range are impossible, but that doesn't stop a computed tensor from holding a 1.02 (float error, an unnormalized vector, a misplaced normalization step). Feed that in and every affected element becomes NaN. It's mathematically correct and practically annoying: your whole downstream computation collapses and the error message won't tell you why. The fix is upstream - clamp inputs to [−1, 1] before the asin, or normalize what you're measuring. If you're getting NaNs and you suspect this node, check the input range first; that's almost always the story.
Two other habits worth forming. Radians, not degrees - scale by 180/π if you think in degrees. And don't confuse Asin with Atan: if your data is a ratio (opposite over adjacent), you want arctan, because atan handles any magnitude and has well-defined behavior at ±infinity. Asin is for when you have a pure sine value that's already bounded.
Install: ComfyUI Manager → "ComfyUI-Pt-Wrapper", or:
cd ComfyUI/custom_nodes
git clone https://github.com/HowToSD/ComfyUI-Pt-Wrapper
then restart. No model downloads; the pack's heavy requirements.txt is the only install cost.
Troubleshooting: NaNs - input out of [−1, 1]; clamp it. Wrong-feeling angles - radians/degrees mix-up. Unexpected behavior on large inputs - that's the domain limit, not a bug. If you keep reaching for arcsin and fighting the bounds, ask whether the underlying data would be more naturally expressed with Atan instead - it often is.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| tens_a | TENSOR | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| TENSOR | TENSOR | — |