ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

I suck in Trigonometry

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Roland R. Kahlenberg
I suck in Trigonometry
on Dec 4, 2013 at 11:22:18 pm

I really do. :-(

Here's why -
1) I have two points, A and B.
A is centered in the comp.
B in position terms is [+290,0] from A

2) I'm trying to auto place objects, using position, around a 290-pixel diameter of a circle.

3) I need to find C, which connects lines between A and C and B and C. I also know the angle for A to C.

What's the Expression to find the (1) length between A and C and
(2) length between B and C?

TIA
RoRK

Intensive mocha & AE Training in Singapore and Other Dangerous Locations

Imagineer Systems (mocha) Certified Instructor
& Adobe After Effects CS6 ACE/ACI


Return to posts index

Dan Ebberts
Re: I suck in Trigonometry
on Dec 5, 2013 at 12:50:31 am

I'm confused. Are B and C located on the circle? Is the circle diameter 290, or is the radius 290?



Return to posts index

Roland R. Kahlenberg
Re: I suck in Trigonometry
on Dec 5, 2013 at 1:10:17 am

Thanks for the reply Dan. The diameter is 290.

Here's the image of what I'm looking at in my comp.



I obviously have position for A. I also have angles for AB and AC (I don't have the position for B and C - as stated originally).

I now need position coordinates for B and C. Sense make?

Thanks
RoRK

Intensive mocha & AE Training in Singapore and Other Dangerous Locations

Imagineer Systems (mocha) Certified Instructor
& Adobe After Effects CS6 ACE/ACI


Return to posts index


Dan Ebberts
Re: I suck in Trigonometry
on Dec 5, 2013 at 1:19:54 am

From your image, it looks like C is at 306 degrees, which would give you this for C's position:

angle = 306;
diameter = 290;
center = [thisComp.width,thisComp.height]/2; // position of A

a = degreesToRadians(angle);
r = diameter/2;
center + r*[Math.cos(a),Math.sin(a)]


Dan



Return to posts index

Roland R. Kahlenberg
Re: I suck in Trigonometry
on Dec 5, 2013 at 2:29:59 am

Thanks Dan! And you were right about the diameter/radius thingy. :-)

Bestest
Roland

Intensive mocha & AE Training in Singapore and Other Dangerous Locations

Imagineer Systems (mocha) Certified Instructor
& Adobe After Effects CS6 ACE/ACI


Return to posts index

Roland R. Kahlenberg
Re: I suck in Trigonometry
on Dec 5, 2013 at 4:51:37 am

AccCKKK!

Points in the first 2 quadrants; from top right work fine. Points on the other 2 quadrants are not accurate.

I'm dealing with 3D layers for the points and each of the cross-sections in the image I first posted are on separate Z-positions. Could this be the issue?

RoRK

Intensive mocha & AE Training in Singapore and Other Dangerous Locations

Imagineer Systems (mocha) Certified Instructor
& Adobe After Effects CS6 ACE/ACI


Return to posts index


Dan Ebberts
Re: I suck in Trigonometry
on Dec 5, 2013 at 5:41:27 am

Probably. It depends on what you're doing with the position values. It might be that you need to include the z coordinate in the position value and then use toComp()to line that up with the camera view.

Dan



Return to posts index

Aimee Murray
Re: I suck in Trigonometry
on Oct 26, 2018 at 12:30:59 pm

7 hours. I've been working with a very similar expression and been so confused as to why it won't work. Then I see your "degreesToRadians" bit of script and the penny drops. Thanks!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]