Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions inTangents, outTangents for perfect circle arcs with createPath?

  • inTangents, outTangents for perfect circle arcs with createPath?

    Posted by Blake Goulette on March 4, 2026 at 3:24 pm

    Hi there. I’m trying to create a perfect circle via createPath, but I’m unsure how to properly calculate the in- and outTangents. I can eyeball it, but I’d rather be able to define precise variables that correctly scale with either the radius or arc length given the contents of my points array.

    Does anyone know the math I need? Here’s the hacky, “pretty close” code I have so far (below), but I think I have to be missing something. (I was never great at math, but I appreciate what it can do — or what one can do with it — when properly understood.) Thanks for looking! [This is applied to the Path property of a shape layer that also has a stroke.]

    let rho = 0.556 // Total magic number

    let _sr = thisComp.layer("Adj FX").effect("Segment Radius")("Slider")

    let offset = [960, 540]

    let handle = _sr * rho

    let points = [

    [-_sr, 0],

    [0, _sr],

    [_sr, 0]

    ]

    let ins = [

    [0, handle],

    [handle, 0],

    [0, 0]

    ]

    let outs = [

    [0, 0],

    [-handle, 0],

    [0, handle]

    ]

    createPath(points, outs, ins, false) // Not sure why these are more predictable when reversed, but...

    Dan Ebberts replied 2 months, 2 weeks ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    March 4, 2026 at 3:38 pm

    I think the actual formula for the “magic number” is:

    (4/3)*(Math.SQRT2 - 1)

    which comes out to about .5523. You were pretty close!

  • Blake Goulette

    March 4, 2026 at 3:46 pm

    Ha! Wow, not so bad, I guess! I had heard of Math.SQRT2 – 1 before, but not the 4/3 — if you have a moment, can you explain where that comes from? I appreciate the response either way!

  • Dan Ebberts

    March 4, 2026 at 5:17 pm

    I don’t remember where I got that formula (I don’t think I derived it), but this might help with the math:

    https://stackoverflow.com/questions/1734745/how-to-create-circle-with-b%C3%A9zier-curves

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy