PDA

View Full Version : Graphing


squadronleader_181st
08-10-2006, 08:20 PM
Hopefully someone can help me. How would I go about graphing easy stuff, like Y=AX equations. I've found a lot of help on Parabolas (X*X) but none for more simple graphs. :confused:

Xeef
08-10-2006, 08:36 PM
hi and welcome to As.Org

not realy understand you !

in you equatation you have 3 variables wich woud result in a 3D graph

give more info !

squadronleader_181st
08-15-2006, 04:29 PM
You're right, it would be 3-D. I didn't mean for it to appear that way. The equation i wanted could be more accurately written as X=2Y, but i'd put in imput texts to that the user could change X, Y, and also 2, making that number a varible of sorts. It would be a 2-D graph.
Sorry for the confusion.
Squadonleader

Xeef
08-15-2006, 05:12 PM
lineStyle(3, 0, 100);
X = 0;
onEnterFrame = function () {
FormulaResult = X*2;
//if you wana have this dynamic by the means of an user input
//you will need to make a parser for it
//wich can become prety complicated
//depending on the aloved complexiti of the input
//eg Y=(X*2+(4/X)^(X-2))/X
//to pares this it isn't an easy thing !
//search for "calculator" they usualy doesn't draw graphs
//but need to parse the input
//so there you can look and get ideas how to make the parser
lineTo(X, FormulaResult);
X++;
};
//P.S
//as you see on the output of this in Flash the Y grows downward mean
//X:0 Y:0 is the top left corner and not as by an
//usual graph the left bottom

squadronleader_181st
08-15-2006, 08:41 PM
Thank you, i will look for a calculator program.
I uinderstand about the graph starting from the top. That's ok.
thanks again,
Squadronleader