Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Statistics 1

Status
Not open for further replies.

Brian56

Programmer
May 29, 2003
66
CA
Hi,

For an educational cd (to be distibuted to schools) I have to write a number of statistics functions.

The approach I have taken is to store the data in an array. I have no problem with the simpler functions like sum and average of the numbers in the array but Flash does not appear to natively support many math functions so I have run into problems with some of the other functions I must have.

I need to have mean, median and frequency.

Once I get this done I run into a whole new set of problems (geometry) as i have to allow the kids to input a function and then have Flash draw the lines. If anyone has done something similar I could use a push in the right direction.

Thanks


Brian
 
saw a math package the other day that does much of that. soon as i get home ill look it up and post the url
 
for the math



for the lines once you figure out a way to get the function into flash it ought to be straightforward. then its just a matter of looping through a for loop so many times and caculating the y values for x values storing the results in an array. you then have an array of points you can connect using lineTo.

as this is to be a cd i tell you all this would be so much simpler in director.
 
What a great link, Bill.

Many thanks !!

I understand what you are saying about drawing lines and that was the method that I had in mind. My problem remains unchanged though. The children have to be able to experiment with different functions and learn what they look like and its the interface for this section that I am having trouble with.

Any thoughts you may have on this would be greatly appreciated.


Brian
 
lots of ways you could go i guess

what about a listbox contianing the types of functions they have to look at. depending on what they click have the change handler prompt them for input and build up the equation that way with a dynamic box displaying their equation as they build it up. a button to click to say done, do the math, generate the pts, draw the graph
 
Hi,

One last question. I cannot get Flash to properly display the equations. How can I add superscripts to the textbox with actionscript?


Brian
 
to this you can add the results from the input text boxes

second = "²";
third = "³";
equation.text = "y = x" + third + " + x" + second;

get the superscripts with ALT + 0178 and ALT + 0179. this will work with most common fonts but not all
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top