Learn how to use flash (42) parameter equations in flash every day

Source: Internet
Author: User

Today I read my high school mathematics book once and found that it is really a great fortune. Using parameterized equations in mathematics can create more results for flash. For example, we set X as the angle for the elliptical parametric equation. If we know the parametric equation, we can calculate the coordinates of any M (x, y) Point.

X = A * cosx

Y = B * SiNx

For example

VaR ANGEL: number;
VaR speed: Number = 0;
VaR array: array = new array ();
For (var I: Int = 0; I <10; I ++)
{
VaR copyball: ball = new ball ();
Copyball. addeventlistener (event. enter_frame, runing );
Array. Push (copyball );
Addchild (array [I]);
}

Function runing (Event: Event): void {
For (var j: Int = 0; j <10; j ++)
{
Angel = (J * Math. Pi * 2/9) + speed;
Trace (Angel );
Array [J]. x = 230 + 50 * Math. Cos (Angel );
Array [J]. Y = 200 + 200 * Math. Sin (Angel );
Array [J]. scalex = 0.5 * Math. Sin (Angel) + 0.7;
Array [J]. scaley = 0.5 * Math. Sin (Angel) + 0.7;
Array [J]. Alpha = 0.5 * Math. Sin (Angel) + 0.7;
}
Speed ++ = 0.003;
}

For example:

Array [J]. x = 230 + 50 * Math. Cos (Angel );
Array [J]. Y = 200 + 200 * Math. Sin (Angel );

This is an application of parameterized equations. (230,200) is the coordinate after the elliptical translation, while

X = 50 * Math. Cos (Angel );

Y = 200 * Math. Sin (Angel );

This is the parameterized equation we are going to talk about today. In order to get any M (x, y), we can use the geometric mathematics of high school to know its wonders. As long as we know about the parameter equation, you can create a lot of magical effects. For example, some of the frequently used high-school parameterization equations in physical motion can be used to calculate some good examples of the above throwing and oblique throwing motion. This is an introduction. In the future, I will write all my notes here as my backup. Flash

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.