
Senior Member
The Math Class?
I've been looking at the Math class a little bit as well as the Conversion Calculator on the Exchange which uses the round() method.
I was hoping someone might reply here as to other uses of this class and maybe point to some examples, in particular the use of the trigonometry methods of the Math Class. I had done an "angle finder" in excel once which used trig and suppose one could do that in KoolMoves similar to the converter.
Anyone?

Senior Member
Guess I need to browse around the rest of flashkit. I just looked into the Math and Physics forum which may be of use to those interested in this topic. It may be a moot point considering the fact that I am writing to myself. I must be going crazy.

I'm not sure what you are looking for since the Math class is easy to use and well documented ( http://help.adobe.com/en_US/AS3LCR/Flash_10.0/Math.html ).
You can use it like this
Code:
var dx:Number = 40;
var dy:Number = 5;
var a:Number = Math.atan2(dy, dx) * 57.296; // angle
var d:Number = Math.sqrt(dy * dy + dx * dx); // distance
trace (a);
trace (d);
The functions it has are static functions so you don't create an instance of the class but call the functions directly.

Senior Member
Not really trying to solve a problem, just looking for how someone might apply the class in a Koolmoves Project and not so much the science. Looking more for how trig might be applied.
I think it goes to the problem of lifting math out the classroom and into real life. Once that is done it becomes useful. Otherwise it remains a set of formulas on paper.
Last edited by etuom; 08212009 at 10:15 AM.

Senior Member
just wanted to add this.
In the American Public Education system they taught math strictly as a science, at least where I went to school at the time. Endless formulas and crunching numbers which apparently had no point. As a result, I didn't pursue math as I didn't have a basis to appreciate the usefulness of it. Later, I began to appreciate it but was way behind the learning curve and so began to teach myself trigonometry with a view to using it in my work. Hard to do in your 40's.
So maybe this will explain a little where I am coming from, particularly those who don't have the same experience.

Senior Member
Later, I began to appreciate it but was way behind the learning curve
Here's a little more . . .
About 8 years ago I was on a painting job and ran out of material that was pretty expensive. The only thing left to do was a log handrail and it was of significant length. All cylinders. I couldn't afford to guess. My partner remembered how to find the surface area of a cylinder so we measured it all up and got the square footage with the formula, figured we need two more gallons and it turned out just right, no waste, no more trips, no lost time. I thought that was very cool and determined to start getting math back into my work and everyday life.
Gee Wilbert, you sure know how to get people to talk!
Last edited by etuom; 08212009 at 11:08 AM.

Originally Posted by etuom
Gee Wilbert, you sure know how to get people to talk!
Math.min and Math.max can be useful to limit values.
Math.atan2 can be used to calculate an angle if you want to rotate a movieclip in the direction of another object.
Math.random can be used to get a random number.
There's lots of situations where math is useful.

Senior Member
Thanks Wilbert,
There's lots of situations where math is useful
.
As can be seen if one takes a look at some of the classes that ship with Koolmoves! On a hunch I looked at the Necro classes and saw it used and then looked at your component classes and saw it used there as well.
Here is a tutorial found here at flashkit that uses Math for "eyes that follow the cursor". It's for Flash users but it shows the code if anyone is interested.
http://www.flashkit.com/tutorials/Ma...738/index.php
So with that I'll have to bow out of this thread as I'm feeling spread too thin. (that's almost poetic, thread  spread ) I would still be interested to see examples in Koolmoves if anyone is inclined.

KoolMoves Moderator
My thumbnail class uses ceil to round up when calculating the need rows.
Posting Permissions
 You may not post new threads
 You may not post replies
 You may not post attachments
 You may not edit your posts

Forum Rules

Click Here to Expand Forum to Full Width
