[futurebasic] Re: Coordinate geometry.

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 1997 : Group Archive : Group : All Groups

From: the world has turned and left me here <shepardb@...>
Date: Fri, 12 Dec 1997 20:32:53 -0500 (EST)
There's another way to solve a set of 2 two-variable equations. It uses
something called Cramer's rule, which you could probably find in a
semi-advanced geometry or pre-calc class. You can break the rule down into
variables that lower life-forms such as computers can interpret.

FYI, the reason I know this is because I wrote a program for the TI-82 the
does the same thing for a set of 3 three-variable equations. The math is a
little different, but it shows the basic idea beheind the process. I could
dig the program out (in *.82p form) is anyone is interested. HTH,

Bryan Shepardson

Mrs. Foster: Just remember, Father Mike, I own you.
Father Mike: I work for God.
Mrs. Foster: He works for me too.

On Thu, 11 Dec 1997, Brian Victor wrote:

> At 9:08 AM -0500 12/11/97, Chris wrote:
> >>Does anyone know the answer to these two geometry questions?
> >>
> >>1. The formula for finding the intersection point of two lines.
> >The intersection point of two lines is found by setting the two line
> >equations equal to each other, solving for x and then substituting that
> >value into one of the original equations to find y.
> That's exactly the concept.  Getting it into BASIC is just a matter of
> reducing it to two equality statements.  For the moment, I'll assume that
> your linear equations are in slope-intercept form.  (y=mx+b)  If they're
> not, you'll have to add a step to get them there.  For each equation, you
> have two coefficients, and therefore two variables.
> y1 = ax + b
> y2 = cx + d
> a, b, c, and d are your variables.  Through algebra we can solve for x in a
> form that will work nicely for an assignment statement.
>  ax + b = cx + d
> ax - cx = d - b
>  (a-c)x = d - b
>       x = (d-b)/(a-c)
> That last line will plug right into BASIC, with changes allowed for your
> own particular variable names.  Note however that it would be prudent to
> make your x and y variables either single or double precision variables
> (append either a # or a ! to the variable name: x# or x!) in order to allow
> for the decimals that you're likely to run into.  To locate the y
> coordinate, take one of your original equations and plug in your x value,
> which you now know:
> y = a * x + b
> This should solve your first problem for you.  The second will be more of a
> challenge.  I'll look it over and see what I can come up with.
> -- Brian Victor
> --
> To unsubscribe, send ANY message to <futurebasic-unsubscribe@...>