Re: [Flashcoders] How to solve SSS triangle?

2005-11-22 Thread ryanm
I am having 3 movie Clips named point1_mc, point2_mc, point3_mc in the 
stage. They are arranged  in such a way to form a triangle...

Now how can i get those 3 angles and sides formed by these points.?


   With a high school geometry textbook? ;-)

Law of cosines: c^2 = a^2 + b^2 - 2ab*Cos(q)
Where a, b, and c are the sides, and q is the angle opposite c

ryanm
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] How to solve SSS triangle?

2005-11-22 Thread Pandian

Thank u... :-P

ryanm wrote:

I am having 3 movie Clips named point1_mc, point2_mc, point3_mc in 
the stage. They are arranged  in such a way to form a triangle...

Now how can i get those 3 angles and sides formed by these points.?


   With a high school geometry textbook? ;-)

Law of cosines: c^2 = a^2 + b^2 - 2ab*Cos(q)
Where a, b, and c are the sides, and q is the angle opposite c

ryanm
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



--

Hi

Thanks and Regards,
Peria Pandi. J
Flash Programmer,
+91 9886742392
Excel-Soft Technologies Pvt Ltd,
1-B,Hotagalli Industrial Area,
Mysore - 570018
Karnataka.

Love your Job. But dont fall in love with your Company !


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] How to solve SSS triangle?

2005-11-22 Thread Rahul
Hi Ryanm,

Here is a function which I wrote a long time back. It calculates included
angle it uses cosine rule to calculate the angle.
The other function calculates shortest distance between two points.


function getAngle(vertex1,vertex2,vertex3){
 var a = (measureLength(vertex2,vertex3));
 var b = (measureLength(vertex3,vertex1));
 var c = (measureLength(vertex1,vertex2));
 var abc1 =  (((a*a)+(c*c)-(b*b)) / (2*a*c));
 var angle =(Math.round(Math.acos(abc1)*(180/Math.PI)));
 return(angle);
}

 function measureLength (obj1, obj2) {
var diffx = (obj2._x-obj1._x);
var diffy = (obj2._y-obj1._y);
  return (Math.sqrt((diffx*diffx)+(diffy*diffy)));
 }

Regards,
Rahul

- Original Message -
From: ryanm [EMAIL PROTECTED]
To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Tuesday, November 22, 2005 4:30 PM
Subject: Re: [Flashcoders] How to solve SSS triangle?


 I am having 3 movie Clips named point1_mc, point2_mc, point3_mc in the
  stage. They are arranged  in such a way to form a triangle...
  Now how can i get those 3 angles and sides formed by these points.?
 
 With a high school geometry textbook? ;-)

 Law of cosines: c^2 = a^2 + b^2 - 2ab*Cos(q)
 Where a, b, and c are the sides, and q is the angle opposite c

 ryanm
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] How to solve SSS triangle?

2005-11-21 Thread Pandian
I am having 3 movie Clips named point1_mc, point2_mc, point3_mc in the 
stage. They are arranged  in such a way to form a triangle...

Now how can i get those 3 angles and sides formed by these points.?
Thank u
-Pandian

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] How to solve SSS triangle?

2005-11-21 Thread Danny Kodicek



I am having 3 movie Clips named point1_mc, point2_mc, point3_mc in the
stage. They are arranged  in such a way to form a triangle...
Now how can i get those 3 angles and sides formed by these points.?


Sides are given by the lengths of the vectors between the points (eg: x = 
point1_mc._x - point2_mc._x, y = point1_mc._y - point2_mc._y, so side length 
=sqrt(x*x + y*y) )


Once you have these sides, you can use the cosine rule to find the angles: 
If you know the three sides a,b,c, the angle A between the sides b and c is 
given by a*a = b*b + c*c - 2*b*c*cosA.


To get acos(A), you need to use atan(A): acos(A)=atan(A/sqrt(1 - A*A))

Best
Danny 


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders