-
inTangents, outTangents for perfect circle arcs with createPath?
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...