Probably both. For any function, you will need to provide an algorithm to solve it. It might get ugly trying to calculate it all in GUI with many variables and what not.
A good way to organize is write your own custom function that pass in a, b ,c and return you x (might need another parameter to decide you want x1 or x2. And then run it whenever you want. Also make sure that b^2 - 4ac > 0 so that you have at least 1 solutions
Wow, why don't teachers ever tell us that. People always ask why we would need to know this and they always give us answers like for carpenters or anyone who needs exact lengths and angles. Does that mean you make all the physics yourself? Sounds like a lot of work.
I use a quadratic formula for calculating creep HP in Sorcerer's Defense. x is the current wave and a b and c are based on the difficulty level. Math tends to be very useful in game design - just take a look at the spreadsheets people make for WoW.
So you take out your calculator and make it solve the quadratic instead ? Calculator still have to be programmed by someone else. Its only your job now to program your own calculator.
Physics engine deal with a lot of equations, most of them are quadratic like force, velocity, acceleration. But its not really hard when you have some basic function of your own. Then you just have to call it and pass in value accordingly.
I did a test, a while ago now, to see if I could get projectile motion working in SC2 by imputing the equations by hand and that worked quite well. The mathematics tools that the editor has available to it is quite impressive from what I've seen.
Say 5 = 6x + 15x^2
How do you solve for x?
using GUI triggers
Is this SC2Mapster.com or HomeworkHelper.com?
But seriously, let's see, it's been a few years since high school math but I think I still remember the quadratic forumula...
x = (-b +- sqrt(b^2 - 4ac))/2a
@RileyStarcraft: Go
That seems to be about right. I'm only in calculus and this stuff is so boring. Why would you need a quadratic?
@RileyStarcraft: Go
Probably both. For any function, you will need to provide an algorithm to solve it. It might get ugly trying to calculate it all in GUI with many variables and what not.
A good way to organize is write your own custom function that pass in a, b ,c and return you x (might need another parameter to decide you want x1 or x2. And then run it whenever you want. Also make sure that b^2 - 4ac > 0 so that you have at least 1 solutions
@Keyeszx: Go
They're a painful if you want to try any kind of physics engine
@progammer: Go
Wow, why don't teachers ever tell us that. People always ask why we would need to know this and they always give us answers like for carpenters or anyone who needs exact lengths and angles. Does that mean you make all the physics yourself? Sounds like a lot of work.
I use a quadratic formula for calculating creep HP in Sorcerer's Defense. x is the current wave and a b and c are based on the difficulty level. Math tends to be very useful in game design - just take a look at the spreadsheets people make for WoW.
@Keyeszx: Go
So you take out your calculator and make it solve the quadratic instead ? Calculator still have to be programmed by someone else. Its only your job now to program your own calculator.
Physics engine deal with a lot of equations, most of them are quadratic like force, velocity, acceleration. But its not really hard when you have some basic function of your own. Then you just have to call it and pass in value accordingly.
@RileyStarcraft: Go
That's cheating, you just calculate it, you didn't solve it.
I did a test, a while ago now, to see if I could get projectile motion working in SC2 by imputing the equations by hand and that worked quite well. The mathematics tools that the editor has available to it is quite impressive from what I've seen.