Page 1 of 1

Make a Triangle

Posted: Sat Sep 27, 2008 10:15 pm
by maxs
Is it possible to construct a triangle by passing it 3 angle measurements?

I tried combining 3 separate angles using "arcangle", but I can't get them to connect.

Any ideas? Thanks, Max

Posted: Sat Sep 27, 2008 10:49 pm
by malte
Hey max,

as an AE user you have it pretty easy here. You can use the pointOnCircle function to construct a triangle.

Code: Select all

on mouseUp pMouseBtnNo
    start using stack "animationengine"
    local tList
    put pointOnCircle(100,100,0,80) into tlist
    put cr & pointOnCircle(100,100,90,80) after tlist
    put cr & pointOnCircle(100,100,180,80) after tlist
    put cr & pointOnCircle(100,100,0,80) after tlist
    set the points of grc "freehandPoly" to tList
end mouseUp
HTH,

Malte

Triangle

Posted: Sun Sep 28, 2008 12:16 am
by maxs
Wow, thanks Malke,

I was almost 100% sure that this could not be done. You had a solution in minutes. Thanks. Animation Engine has been a lifesaver.

I am unable to test the code. For some strange reason, the script requires an AE password. My AE 2.0 password does not work. Any ideas? Max

Try- angle

Posted: Sun Sep 28, 2008 8:59 am
by maxs
Hi Malke,

The password problem seems to reside in Rev 3.0 only.

But the code was unclear as how to set the angles. I need to be able to set the angles of two corners of the triangle, so your code may not work. For example, if one corner is 60 degrees, another might be 90 degrees.

Thank you, and please let me know if you have any ideas. Max

Posted: Sun Sep 28, 2008 10:10 am
by malte
Hi Max,

first for the unlock code problem. Which version of AE are you using? I do not see the problem here in 3.0 with the latest AE version at least.

Could you please explain what exactly it is you are trying to do? Do you want to set the angle at each point of the triangle? If so the code might need to change. What my previous example does is take 3 points constructed around the center of the circumcircle of the triangle. If you want to calculate the point given the angle at each leg of the triangle, this is also possible, but requires a little more scripting.

All the best,

Malte

Posted: Mon Sep 29, 2008 8:46 pm
by mwieder
Max- actually just three angles isn't enough information to generate a unique triangle, rather it defines a class of similar triangles. You'd need more information - the length of one side, for example, or the positions of two points.

Posted: Sun Oct 12, 2008 7:46 am
by maxs
Thanks to all!

I realize now that construction a triangle using angles has a few inherent problems which do not make it practical. For example, a triangle with 2 80 degree angles would be very narrow or very large.

Thanks for the quick responses.