Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Who's right, VB or VFP?
Message
 
À
11/07/2002 04:43:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00676246
Message ID:
00678585
Vues:
22
It all depends on which quadrant you are in. I guess no one else liked the trigonometry class in High School enough to remember it. (I'm not saying I enjoyed it either - my most hated math class EVER). Cindy is correct, if we are talking about the first quadrant (X positive and Y positive). In Len's example, that's the second quadrant (X negative, Y positive). However, even in Len's example, the slope of that line would be a positive number. The kicker comes in where computers have 'traditionally' defined the origin to be the upper left of the screen, which would normally correspond with the 4th quadrant (X positive, Y negative) except that computers still use positive numbers for the Y axis, kind of an 'absolute value' version of the 4th quadrant. Thus, a positive slope would be from upper left to lower right, and a negative slope would be lower left to upper right. Fox is 'mathematically' correct and the others are 'computer' correct. Confusing? You bet, but it simple comes from the concept of number lines 'down' the page. It drove me nuts way back on my first 'real' computer when I'd create a graphing formula that should have generated a line going from the lower left to upper right, but it went the other way instead. Annoying, because it went against everything I had learned in my math classes.

Randy

>>In all my math classes, the X axis was horizontal and the Y axis was vertical. (0,0) was always somewhere on the lower left. Is the "usual" picture different in the UK?
>>
>>Y Axis
>>|   /
>>|  / <<- Positive slope
>>| /
>>|/_______________ X Axis
>>(0,0)
>
>That is the usual representation of the axes & a positive slope (which I would also call an upward diagonal). But in many computer graphics systems, including VFP, VB, VC++, 0,0 is situated at the top left & the positive direction for y is downwards. In the majority of graphics libraries I have used over the years, I can only remember one occassion where I didn't write my own front-end library of routines to put the origin back to the bottom right so I could use a natural coordinate system.
>
>I think this is where the confusion may have come from - upward diagonal has been used in the mathematical sense of increasing y value with increasing x value (hence top left to bottom right) rather than the normally accepted sense of your image.
>
>I'm still pondering in which direction I would expect an upward diagonal to go as I traverse the negative side of the x-axis - does it go upwards or downwards. In other words is an upward diagonal one where the y value increases with distance from the origin.
>
>
>                Y Axis
> Upward ->>\   |
> Diagonal ? \  |
>             \ |
>______________\|
>X Axis -ve side(0,0)
>
>
>"Upward" is a relative term depending on direction of travel, a valley consists of a negative slope followed by a positive slope (left to right), but from the bottom which ever direction you travel you always go upwards.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform