Confusion about modified formula

Hello, I tried the challenge with the formula and I made a mistake by doing y1-y2 / x1 - x2 and even so, the result was correct. I only know if it is reversed in calculating vector direction, it gets the opposite direction, but here it is the same. It only changed on which side of the division line thingy (I do not know the English word for it :smiley:) the minus sign is. So I am wondering if it is a serious mistake and will eventually bite me in the ass, or why it even works in the first place. Thanks for reading!

1 Like

Hi @Desfell, we’ve mostly been dealing with negative gradients so far, since we’re concerned with fuel running out over time. Depending on which order you subtract the points, you’ll just end up with a single negative sign on either the top or the bottom of the fraction. This doesn’t really matter though since -a/b = a/-b = -(a/b).

However, if you try doing this with a line that has a positive gradient then you’ll find that one way will be easier to work with than the other.
If you take the second point away from the first then you’ll end up with two positive values and you’re done.
If instead you take the first away from the second, you’ll end up with two negative values and will have to add an extra step to simplify things.
The end result in either case will still be the same but doing it the “wrong” way just creates some unnecessary work that could have been avoided.

I’d recommend playing around with this to see for yourself since it’s great practice and should help you understand it better.

Anyway, I hope that answers you question. If you’d like me to clarify anything, just let me know.

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms