GetSlope

Blitz3D Forums/Blitz3D Beginners Area/GetSlope

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

In the most basic form, the slope of a line is the tangent
(y2-y1)/(x2-x1) as calculated from the point lowest on the line (most negative Y-value). The equation of a line is often given as Y=mX+C, where m represents the slope. If you know two points on a line, with the coordinates of (x1,y1) and (x2,y2), you can use the above relationships to determine the slope. Lines that are parallel to each other have the same value for m. If any point on a parallel line intersects a point on another line, they are two segments of the same line. If the slope of one line is the negative reciprocal (m1 = -1/m2) of another line, they are perpendicular (at right angles to each other). If two non-parallel lines are extended, they must intersect each other at one point, and one point only (unless you want to talk about curved space).

What it comes down to is this: You can find a way to solve your problem using functions built into Blitz, or you can consider this as a math challenge and find a way to do it with a bit of geometry. Your call.