# Revised Tangent Node

I am slowly working away on the next update to my node library, not only adding new nodes but improving existing ones.

Attached is a much improved version of my tangent node. My original node used a bunch of math to do something which could be done much more efficiently and easily using the point_on_path node. The new node has the following advantages/differences:

- MUCH faster, important for very long paths
- No longer requires any external Python libraries
- No more division by zero errors (which could happen very rarely with the old node)
- More accurate endpoints (based on the true end point, not the 99.99% point)
- Handles endpoints correctly even in multi-contour paths
- Inflection point values now based on the average of slopes just before and after (instead of on one or the other)
- Tangent values automatically set to four digits of precision (avoiding weirdness which could occur with near-zero values)

One known issue: For multi-contour paths, if you set the T value to the exact position (within plus or minus one ten-thousandth of one percent) of the point at which one contour jumps to the next, the tangent will reflect the direction of the jump. The might be considered a feature instead of bug. And fixing it would have complicated the node and slowed it down, all for an extreme corner case that is unlikely ever to even be noticed. It's also easy to avoid by simply separating multi-contour paths using my contours node.

The attached demo lets you apply the tangent node to a wide variety of different paths. Just hook a shape (text, polygon, arc, etc.) to the null node and adjust the T value to see the resulting tangent value.

The tangent node is a workhorse - I use it all the time. If you are using my old tangent node, replacing it with this one could reduce your render times.

Enjoy!

John

- tangent_demo_screenshot.png 357 KB
- New_Tangent_demo.ndbx.zip 5.52 KB

# Keyboard shortcuts

### Generic

? | Show this help |
---|---|

ESC | Blurs the current field |

### Comment Form

r | Focus the comment reply box |
---|---|

^ + ↩ | Submit the comment |

You can use `Command ⌘`

instead of `Control ^`

on Mac