Math Cosmetics!

Started by
19 comments, last by Dmytry 19 years, 8 months ago
These questions may seem a bit unusual, but let's give it a try: 1) Why is the default slope formula "m = (y2-y1)/(x2-x1)" and not "m = (y1-y2)/(x1-x2)" 2) Say you have to label two arbitrary points on a line, with the labels P1 and P2, would you put P1 to the left and P2 to the right, just because it looks nice? Or are there any official rules involved? Tnx
Advertisement
And what do you do if the line happens to be vertical? ;)
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall
Quote:Original post by Muzzafarath
And what do you do if the line happens to be vertical? ;)


Hehehehhe
Ack, try to stay away from the homework questions.

But while I'm here, I guess the reasoning behind the (y2-y1)/(x2-x1) is that if the line has a positive slope, you will be left with a positive numerator and denominator. (EDIT: and if the line has a negative slope, either numerator or denominator will be negative. So P2-P1 lets you work with negatives less. Everyone hates negatives hahaha =)

Official rules about it would be stupid, as the two are perfectly equivalent

(y2-y1) / (x2-x1)
-(y2-y1) / -(x2-x1)
(y1-y2) / (x1-x2)
Quote:Original post by Neosmyle
But while I'm here, I guess the reasoning behind the (y2-y1)/(x2-x1) is that if the line has a positive slope, you will be left with a positive numerator and denominator. (EDIT: and if the line has a negative slope, either numerator or denominator will be negative. So P2-P1 lets you work with negatives less. Everyone hates negatives hahaha =)


Thank you, that's pretty clear. From what you are saying here I can also deduce the points (x1,y2) and (x2,y2) are put on the line from left to right by default :)

[Edited by - Raab314159 on August 3, 2004 4:25:05 PM]
No, they are not put on the line from left to right by default... nor is the ordering determined by the direction the line runs... well, at least, not directly.... the direction the line runs is a consequence of something else... and that is trigonometry.

The gradient of a line, m, (which you must remember is a gradient relative to something else) is equal to the tan of the angle between the line and the positive x axis. So, we know that the gradient is measured relative to the positive x axis. tan increases from zero with positive angle from 0 radians up to pi/2 radians, so therefore gradient must also increase in that direction. If the gradient of the line is defined by the change in the vertical direction divided by the change in the horizontal direction, then the this implies an ordering on the points on the line and in the equation for gradient.

As to what happens when the line is vertical, you have an infinite vertical change divided by a zero horizontal change, which gives an infinite gradient (which can be confirmed by checking that the tan(pi) = infinity.

Cheers,

Timkin
1) The vector that goes from (x1,y1) to (x2,y2) is (x2-x1,y2-y1). You can then get the slope by dividing (y2-y1)/(x2-x1). I find that choice more elegant.

2) Ask a mathematician to draw an arbitrary line, and you will get a horizontal line. Ask him to put two points P1 and P2 on it, and you will get P1 on the left and P2 on the right. We mathematicians have limited imaginations. :)

Ask me to do an arbitrary line and you get a 45 degree positive slope, but maybe that's because I'm a physicist?

Any other disciplines want to add to this little psychological experiment?
I will go for the .25 * PI radians line.. but that's because I'm a programmer ;)

About the labeling.. If I draw a 45 degrees line I would label the left point (x1,y1) and the right point (x2,y2) just because I read from left to right and the numbers go from low to high..

But I would calculate m then with (y2 - y1) / (x2 - x1) to make sure I get a positive slope.
If asked to draw an arbitrary line, I'd draw a circle... it's one of the hardest shapes for a human to draw, yet one of the simplest and most elegant! ;)

...and I doubt this choice has anything to do with my educational training (maths/physics/philosophy/computing).

Timkin

This topic is closed to new replies.

Advertisement