Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

- Home
- After Effects
- Discussions
- Calculating auto tangent for 3 random points

- Calculating auto tangent for 3 random points

/t5/after-effects-discussions/calculating-auto-tangent-for-3-random-points/td-p/13035031
Jun 28, 2022
Jun 28, 2022

Copy link to clipboard

Copied

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Adobe Community Professional
,
Jun 28, 2022
Jun 28, 2022

I think the formula for the auto bezier out tangent is (next point - previous point)/6 and the in tangent is the inverse of that. So building your 3-point path with an expression would look like this (although the tangents for the first and third points don't match what you have in your illustration):

```
p1 = [561,589];
p2 = [1105,256];
p3 = [1188,787];
p = [fromComp(p1),fromComp(p2),fromComp(p3)];
iT = [[0,0],(p1-p3)/6,(p2-p3)/6];
oT = [(p2-p1)/6,(p3-p1)/6,[0,0]];
createPath(p,iT,oT,false);
```

New Here
,
Jun 28, 2022
Jun 28, 2022

In Rotobazier, intangents and out tangets are parallel to the line formed between previous point and next point and lengths of those tangets are 1/3 (or close to ) of length between current point and previous point ( for in tangent) , 1/3 of length between current point and next point (for out tangent ).

Same is illustrated with expression below.

p1=fromComp(thisComp.layer("1").transform.position);

p2=fromComp(thisComp.layer("2").transform.position);

p3=fromComp(thisComp.layer("3").transform.posi

4
Replies
4

/t5/after-effects-discussions/calculating-auto-tangent-for-3-random-points/m-p/13035109#M204316
Jun 28, 2022
Jun 28, 2022

Copy link to clipboard

Copied

http://www.motionscript.com/expressions-lab-ae65/bezier.html

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

/t5/after-effects-discussions/calculating-auto-tangent-for-3-random-points/m-p/13035388#M204330
Jun 28, 2022
Jun 28, 2022

Copy link to clipboard

Copied

What "auto-tangent"? There is no specific formula for that and the criteria for the tangents are completely arbitrary and up to whatever you deem suitable. Otherwise you simply can mimic a standard B-Spline behavior by hard-coding a few values in the Bèzier formula so it effectively is only a bicubic spline like zeroing out the third component.

Mylenium

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

/t5/after-effects-discussions/calculating-auto-tangent-for-3-random-points/m-p/13035543#M204342
Jun 28, 2022
Jun 28, 2022

Copy link to clipboard

Copied

I think the formula for the auto bezier out tangent is (next point - previous point)/6 and the in tangent is the inverse of that. So building your 3-point path with an expression would look like this (although the tangents for the first and third points don't match what you have in your illustration):

```
p1 = [561,589];
p2 = [1105,256];
p3 = [1188,787];
p = [fromComp(p1),fromComp(p2),fromComp(p3)];
iT = [[0,0],(p1-p3)/6,(p2-p3)/6];
oT = [(p2-p1)/6,(p3-p1)/6,[0,0]];
createPath(p,iT,oT,false);
```

Community guidelines

New Here
,

LATEST
/t5/after-effects-discussions/calculating-auto-tangent-for-3-random-points/m-p/13037178#M204433
Jun 28, 2022
Jun 28, 2022

Copy link to clipboard

Copied

In Rotobazier, intangents and out tangets are parallel to the line formed between previous point and next point and lengths of those tangets are 1/3 (or close to ) of length between current point and previous point ( for in tangent) , 1/3 of length between current point and next point (for out tangent ).

Same is illustrated with expression below.

p1=fromComp(thisComp.layer("1").transform.position);

p2=fromComp(thisComp.layer("2").transform.position);

p3=fromComp(thisComp.layer("3").transform.position);

// 3 Nulls to follow for position;

intan2=((p1-p3)/length(p1,p3)) * ( length(p2,p1)/3);

outtan2=((p3-p1)/length(p1,p3)) * ( length(p2,p3)/3);

// number 3 at denometer can be varied to adjust curve (>2 is better)

//((p1-p3)/length(p1,p3)) gives a tangent of unit length in required intan direction.

//((p3-p1)/length(p1,p3)) gives a tangent of unit length in required outtan direction.

pts=[p1,p2,p3];

intan=[[0,0],intan2,[0,0]];

outtan=[[0,0],outtan2,[0,0]];

createPath(points = pts, inTangents = intan, outTangents = outtan, isClosed = false)

Community guidelines

Resources

Troubleshooting FAQs

After Effects Community Recap

Getting started with After Effects

Using the Community
Experience League
Terms of Use
Privacy Policy
Cookie preferences
AdChoices
Language:

- Deutsch
- English
- Español
- Français
- 日本語コミュニティ
- Português
- 한국어

Copyright © 2022 Adobe. All rights reserved.