
1. Re: [as2] Math Finding x, y point
kglad Dec 10, 2010 6:19 AM (in response to marcelozep3)1 person found this helpfulfollowing set of points will lie on that triangle's hypoteneuse:
{x,3/4x}
where x varies from the leftmost to rightmost of the triangle.

2. Re: [as2] Math Finding x, y point
marcelozep3 Dec 10, 2010 8:01 AM (in response to kglad)Yes, thanks, but what would be the formula.
It can me made in pure math, not actionscript.

3. Re: [as2] Math Finding x, y point
kglad Dec 10, 2010 10:24 AM (in response to marcelozep3)y=3/4x

4. Re: [as2] Math Finding x, y point
marcelozep3 Dec 10, 2010 12:41 PM (in response to kglad)point y= (triangle height/triangle width) * point x
Is that right?

5. Re: [as2] Math Finding x, y point
marcelozep3 Dec 10, 2010 1:02 PM (in response to kglad)what if the triangle is not a triangle rectangle?

6. Re: [as2] Math Finding x, y point
kglad Dec 10, 2010 1:37 PM (in response to marcelozep3)1 person found this helpfulyou'll need to use trig if you're not using a "special" triangle. how you'll do that depends on what's known about the triangle. for example, do you know the length of all 3 sides? do you know 2 angles and 1 side? do you know 2 sides and 1 angle?

7. Re: [as2] Math Finding x, y point
marcelozep3 Dec 10, 2010 4:17 PM (in response to kglad)Could you write the formula?
I think it would be great

8. Re: [as2] Math Finding x, y point
Rothrock Dec 10, 2010 4:44 PM (in response to marcelozep3)The following might help:
http://en.wikipedia.org/wiki/Law_of_cosines
http://en.wikipedia.org/wiki/Law_of_sines
http://en.wikipedia.org/wiki/Trigonometry
As kglad stated it depends upon which bits of the triangle you already know and which bits you are trying to find. But given that Flash is generally viewed through the x/y grid you can usually resolve things to a right triangle and use the basic identities. Most stuff in Flash requires only some basic trig and not the far more generic identities and equations.
What are you actually trying to do?

9. Re: [as2] Math Finding x, y point
marcelozep3 Dec 10, 2010 5:04 PM (in response to Rothrock)I´m trying to make this happens:
I´m trying to find the rotation value to add to the green movieclip hanged by the claw, so it rotates right and left a bit to give an idea of displacement, when the claw catches it.
It would be in a onEnterFrame method. I need to know what would be the rotation values to make it happen, to make the idea of displacement.
I think that´s hard isn´t it?
Thanks

10. Re: [as2] Math Finding x, y point
Rothrock Dec 10, 2010 5:32 PM (in response to marcelozep3)Yeah, generally what you seem to be pursuing is going to be difficult. Especially if you don't have a lot of math skills.
I would probably recommend faking it. Just do some kind of damped rotational easing to make it look good. Unless you need something closer to physical reality it would probably be the best solution.
Otherwise you probably want to find some kind of prebuilt physics engine and use that.
http://ntt.cc/2008/03/20/thelistofas3physicsengineopensourcenonopensource.html

11. Re: [as2] Math Finding x, y point
marcelozep3 Dec 10, 2010 7:09 PM (in response to Rothrock)It´s ok, but I needed in actionscript 2.0.
I don´t mind doing the difficult way.
By the way, if I did it in the easy way, I would had to find the angle of equilibrium to rotate a bit right and left.
So, I don´t mind doing the difficult way.
Thanks