Formula with to much constants

Started by
3 comments, last by grhodes_at_work 15 years, 9 months ago
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?
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!
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
By the way, why do you think 3 is too many constants?
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
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?



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.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net

This topic is closed to new replies.

Advertisement