Re: HELP Mathamatical Problem
[Prev][Next][Index][Thread]
Re: HELP Mathamatical Problem
Hyper <jts@NETBISTRO.COM> writes:
> I am stuck on a mathamatical problem which I hope someone out there
> can help me.
>
> I need to write a program on my TI86 which will calculate if a given
> point is within the bounds of a group of other points. Sounds confusing
> I know so I will draw some ASCII art to hopefully clarify the problem.
>
>
> (x,y)*--------------(x,y)*
> / \
> / (x,y)*
> / /
> / (x,y)@ /
> / /
> / /
> (x,y)*------------------(x,y)*
>
> * denotes the "boundary points"
> @ denotes the point in which the program will check if it is
within the "boundary" in this example it is.
>
> Now my question is what basic (code) or math (formula) should be
> used in order to solve this problem?
It looks like you are trying to determine whether a point is in
the interior of a convex region with rectilinear sides. If so, there
is a standard way to handle this. Find the equation of the straight
line determined by two adjacent boundary points, and write it as
an _inequality_ instead of as an equation. The statement is then
satisfied by all points on one particular side of the straight line (depending
which way you have pointed the inequality).
In the example you have sketched, there would be five inequalities.
Only points that satisfy ALL of these inequalities will lie in the
interior of the region.
Unless you had a very standard situation in which you could predict the
approximate shape of the region, etc. this doesn't seem like a very promising
application for writing a program -- better to check your numbers directly on
the homescreen. Of course, if you had a TI-89 or 92 you could write a couple
of helpful little throwaway functions to do much of the "grunt work" for you --
this is possibly an even more significant difference working in this
environment makes than the mere ability to simplify algebraic expressions.
RWW Taylor
National Technical Institute for the Deaf
Rochester Institute of Technology
Rochester NY 14623
>>>> The plural of mongoose begins with p. <<<<