Jump to content
  • Advertisement
Sign in to follow this  
ghotirein

Formula with to much constants

This topic is 3719 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi folks, I have two formulas, they have a lot of constants in them. How can I change them into one constant? here is what I have so far: vecA - VecB ------------ * 0.012 * ( 1.2 - ( p * 0.4 ) ) = Answer |vecA - VecB| Now I have been able to do the last part: 0.012*1.2 - 0.012(p*0.4) correct? 0.0144 - (0.012 * p * 0.4) correct? 0.0144 - (p * 0,0048) correct? so now I have only two constants instead of 3. Can I even reduce this to 1 constant? how do i do that? But I have also a somewhat complexer formula: (vecA - vecB) * 0.8 * (1-|vecC|) ------------------------------ = answer 1.2 - ( p * 0.4 ) With this function I can't even get it to two :s One is considered not a constant so If i could do: 0.8 * (vecA - vecB) * (1-|vecC|) -------------------------------- = answer (1.2 * 1) - (p * 0.4) If I can get that 1.2 in this fashion: 1.2 * (rest, so 1, p, 0.4 with some formula) then I can do 0.8 (vecA - vecB) * (1-|vecC|) --- * -------------------------- -> 0.8/1.2 will be one constant again :) 1.2 rest(1,p,0.4) Okay so can anyone help me with the first formula and can anyone help me with the second formula?

Share this post


Link to post
Share on other sites
Advertisement
Your simplification of the first formula is correct. No, you cannot reduce it to one constant. You could divide by 0.0144 or 0.0048, which would turn one of the remaining constants into a "1", which you consider not a constant; however, you'd have to turn around and multiply by the same number somewhere else, thus re-introducing the second constant.

The second equation can be reduced to two constants, but you don't seem to be approaching it correctly. (Well, you sort of are, but you are getting stuck!) It is fairly basic algebra, and I don't know what your experience with that is. I don't like to give away answers here, since sometimes people do cheat on schoolwork (though I don't have any reason to believe that is your case), so I'll just give a hint. Note that 0.8 is twice as large as 0.4, and 1.2 is three times as larger as 0.4. And that since every variable term in the equation is multiplied by one of these value, you can scale the values proportionally, which will allow you to get rid of one of the 3 constants.

Hope that helps!

Share this post


Link to post
Share on other sites
Hiya,

Thanks for the reply :)
Nice to know that have gotten the first one correct.

Now with your tip I would say that I have to divide by 0.4

this would make:

2 * (vecA - vecB) * (1-|vecC|)
-------------------------------- = answer
3 - p

so now there is one less. Is this correct?



Share this post


Link to post
Share on other sites
Yes, that's correct. Actually, I think your original approach to this would have worked. You just wrote things in a strange way, which made me think maybe you were confused, and the constants you would have ended up with would not be as pretty as the ones you have now.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!