Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Algebra...

Author
Message
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 14th May 2009 20:56
Hello!

OK, here is my problem : I suck at algebra. I have this line of code:

pos=(106-(bar_length/2))+(251/((f#+d#)*16)*(scroll_y))

scroll_y=?

Thanks,

TheComet

Peachy, and the Chaos of the Gems

Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 14th May 2009 21:09
what are these:

Bar_Length,f#,D#

theres to many unknowns and not enough equations

New Site! Check it out \/
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 14th May 2009 21:15
I not sure if we are on the same page. I am not looking for the actual result for scroll_y, but the formula of getting to it.

Like this: x=y*z ====> y=x/z

So lets turn everything into variables:

pos=p-l+(h/m*s)
s=?

TheComet

Peachy, and the Chaos of the Gems

Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 14th May 2009 21:29
I think I juggled the stuff around correctly - here's the derivation to the result:



Enjoy your day.
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 14th May 2009 22:05
First of all, thanks for your effort of solving it (must have been pretty hard!).

Secondly, I think there is some error in the logic, because you only divide and the result in the end is 0.000005-something, but I need a bigger number...

3. How do you do that?

TheComet

Peachy, and the Chaos of the Gems

Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 14th May 2009 23:04
oops! I see a division error that I did. Here's the new derivation:

pos=p-l+(h/m*s)

h/(m*s)=pos-(p-l)
1/(m*s)=(pos-(p-l))/h
m*s=1/((pos-(p-l))/h)

s=((1/(pos-(p-l))/h))/m

I think that's right.

Quote: "3. How do you do that?"


We want to solve for s so we have to get s all alone on one side of the equality. We start by subtracting (p-l) from both sides of the = as a unit:
h/(m*s)=pos-(p-l)

We still want to isolate s so now we chip away at everything on the s side. Let's get rid of h by dividing each side by h
1/(m*s)=(pos-(p-l))/h

Now let's flip 1/(m*s) the correct way to (m*s)/1 . If we flip one side, we have to flip the other:
m*s=1/((pos-(p-l))/h)

Now let's get rid of m on the s side. To do that we divide by m. What happens on one side has to happen on the other side:

s=((1/(pos-(p-l))/h))/m

Enjoy your day.
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 15th May 2009 09:57
There is something wrong in your second result too. I think the error is, that h/m*s isn't h/(m*s).

I tried solving it after you showing me how it is done, and it worked!

pos=p-l+(h/m*s)
pos-(p-l)=(h/m*s)
(pos-(p-l))/h*m=s

Thanks a lot for your help, Latch!

TheComet

Peachy, and the Chaos of the Gems

Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 15th May 2009 10:51
ahhh... the order of operations! I always run into a snag when seeing things in computer script like h/m*s or s*h/m. Somewhere along the line I learned, erroneously I think, that if there were no parentheses that I do the multiplication first. It's a habit I have to think about to break or else I automatically do the multiplication first. Multiplication and division are equal and performed from left to right (unless they are grouped by parentheses) so I'm glad you figured it out for the correct order!

Enjoy your day.
Libervurto
19
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 15th May 2009 16:42
Quote: "Multiplication and division are equal and performed from left to right (unless they are grouped by parentheses) "

Ah, I always have problems with this and end up putting everything in parentheses. I thought it was multiplication first too.

Riddle: The more you take, the more you leave behind. What are they? Answer
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 15th May 2009 19:36
Well, now you know it!

TheComet

Peachy, and the Chaos of the Gems

Login to post a reply

Server time is: 2025-08-08 20:34:35
Your offset time is: 2025-08-08 20:34:35