Imagime this:

You have two graphs graphed on the graph screen, the equasions for which you have. Is there a simple way to check which equasion contaions an inputed point (meaning point on the graph screen, not always a point that works in the equasion).

Do you mean like?:

```
Input Y¹
Input Y²
Input "X=",X
Input "Y=",Y
If Y¹(X)=Y
Then
Disp "X,Y is in Y¹"
End
If Y²(X)=Y
Then
Disp "X,Y is in Y²"
End
```

You can optimize it by using If s rather than If Thens; also

Y_{1}(X)=Y

can be

Y=Y_{1}(X

and you can get rid of that parenthesis.

Actually, that is not what I mean. I mean you have two functions, say, Y_{1}= -.5X+20 and Y_{2}=3X-3, and the user inputs (21,10) Y_{1} is returned because the pixel represented by the point has been turned on by the first function. This is all that matters, it is not important if the point satisfies the equasion.

You would need to know the window size, and then you could find the proportions of the window to pixels, and test to see whether they would intersect. Or if you didn't mine displaying graph:

```
//Input everything
ClrDraw
DispGraph
If pixelTest(21,10)
Disp "Point satisfies."
```

@Roguebantha That doesn't work because I need to know which equasion changed the pixel.

Well I suppose you could still use the window size. Or only turn on one function at a time.

really, it just depends on which function passed through the point first, so the above code does just that: it tells you which programs would have led to that pixel being turned on.

```
ClrDraw
Pt-On(A,B
0→C
For(X,Xmin,Xmax,ΔX)
Y₂(X
Ymax-Ans
int(Ans/(ΔY // this is the most crucial part. I have **no** idea how TI rounds their graphing... so it might be int() or 1+int()
If pxl-test(Ans,C
Then
Disp "Y₂ will draw to this point
Stop
End
Y₁(X
Ymax-Ans
int(Ans/(ΔY // this is the most crucial part. I have **no** idea how TI rounds their graphing... so it might be int() or 1+int()
If pxl-test(Ans,C
Then
Disp "Y₁ will draw to this point
Stop
End
C+1→C
End
```

Does this help?

That's my solution for bsch2734 's original problem.

I think it is crucial at this point to note 3 things:

1. Speed is key in this instance

2. I have a method, but it is too slow (1.5 sec)

3. y-vars do not actually need to be used. The equasions can be strings, or represented by whatever else you can imigine

Okay so here's an idea:

Figure out where the point is on the graph. If a human were to do this:

pixel-on(X,Y)

Input

//The human would then select the pixel in question. Now you know the X and Y position of the pixel in relation to the window.

If Y_{1}(X)=Y

//Do stuff

Hang on, I have code for you, but it's late here and I haven't finished it yet. I'll post it tomorrow.

I've got it! Here's your code:

10/47→Δx

10/31→Δy

ZStandard

Prompt X,Y

Input "Y_{1}=?",Str0

Str0→Y_{1}

(X-47)(Δx)→A

(31-Y)(Δy)→B

{A+Δx,A-Δx}→L_{1}

{B-Δy,B+Δy}→L_{2}

If Y_{1}(L_{1}(1))≥L_{2}(1) and Y_{1}(L_{1}(1))≤L_{2}(2) or Y_{1}(L_{1}(2))≥L_{2}(1) and Y_{1}(L_{1}(2))≤L_{2}(2):Disp "Y_{1} hits point."

Δx and Δy are the variables that determine how far each point on the graph is from the other in relation to pixels. By default, each pixel represents 10/47 in the X direction and 10/31 in the Y direction. Note how 47 and 31 are the dimensions of the calculator screen, halved. This is because in ZStandard, you need to attribute for negative numbers. By knowing how far each point is pixel-wise from the center and vice-versa, you can calculate the point/points that are attributed to each pixel. After the user puts in input, the next two lines of code calculate the minimum points that the pixel could represent. The next two lines after that calculate what other points a single pixel could represent. These bounds are stored in L_{1} and L_{2}. The last line calculates if the bounds are inside of each in relation to Y_{1}. The code worked great for me! :) I hope this works for you! Execution was under a second. This code should be easily adaptable for another equation.

Dino's method does the same thing but it appears to maybe doing some guess and check? I'm not quite sure I understand how it works :)

@Roguebantha:

I may have typed the code into my calculator wrong, so I would like you to try this:

x=.8

y=2.5

Y1=3x

When I tried these values, which should satisify a solution, the code did not identify it.

@Mr.Dino:

Still have yet to play around with your code but I will get to it…

@Everyone,

As I mentioned, I do have a solution which I will share shortly, maybe tomorrow or Friday.

Oh, I'm sorry maybe I didn't make myself clear on what the inputs are? The inputs are the pixel coords and you can't have half a pixel :)

For example, if I were to enter:

X=47

Y=31

y_{1}=X

The answer would be true because in ZStandard, graphing the equation "X" would turn on pixel 47,31 and pixeltest(31,47) would return 1.

Looking back on your earlier examples, maybe I misunderstand what you are trying to do?

You should but once again, my less than satisfactory number theory intelligence ruins me again -__- I had to add one more condition to the if statement. You might need to type the whole if statement in again, sorry, I made a few changes:

If (Y_{1}(L_{1}(1))≥L_{2}(1) and Y_{1}(L_{1}(1))≤L_{2}(2)) or (Y_{1}(L_{1}(2))≥L_{2}(1) and Y_{1}(L_{1}(2))≤L_{2}(2)) **or (Y _{1}(L_{1}(1))≥L_{2}(1) and Y_{1}(L_{1}(2))≤L_{2}(2))**

This is all necessary because each pixel represents so many different points, and calculating for every possibility is kind of complicated, at least for me. And also, since you put in the X value first, you would submit in this order: 58,10,3X. When I did this, it worked fine. :)

I would also like to note that this program can get inaccurate when you get within a few pixels of the equation since the window of detection has to be pretty broad. For example, when you plot the equation "X", point (48,32) does not get turned on. Running it through the program though will return that the pixel does get turned on which is not true. This is because the program has to account for where the line might be. The program never actually uses the graph screen at all and instead calculates the position based on algorithm. Theoretically, what the program is saying would be true on a more accurate and larger screen.

I see. It seems like that could be fixed somehow, maybe I will think about it. The whole point of this excersize is precision and speed, and it seems I keep having to sacrifice one for the other. Maybe my code will spark some ideas when I post it.

Also, the code needs to be able to take in at least 3 equasions and tell which ones contain the point. Consider this during optimization.

Rrrgh this shouldn't be so hard, it's just difficult for me to figure out which numbers go to which points, and the equations that describe them! Is Weregoose here?? I'm certain he'd be able to make my code precise. Or Xeda, he would probably know what to do too.

Taking in three equations would not be difficult though, you just need to add another if statement to the program for each equation you want to test.

Ooh you're right, my bad Xeda :/ It's so easy to fall into a bad habit sometimes….

I got it! Code executes in less than a second and runs with perfect accuracy. The change had to be made in how I calculated the bounds:

10/47→Δx

10/31→Δy

ZStandard

Prompt X,Y

Input "Y1=?",Str0

Str0→Y1

(X-47)(Δx)→A

(31-Y)(Δy)→B

**{(A/(abs(A)+not(A)))(abs(A)+Δx,A}→L _{1}
{(B/(abs(B)+not(B)))(abs(B)+ΔY,B}→L_{2}
SortA(L_{1}
SortA(L_{2}**

//If statement typed out earlier. The other code before the if statement got replaced with the bolded text. I also tested that point you gave me and it worked fine. (The 58,10,3x) one. Keep in mind that the point input is backwards than that of a pixel test. In pixel-test( you put the point in as y,x. In this program, you put it in as x,y.

EDIT: update:

I have tested the program very thoroughly including X^{2}, abs(X), -X, X, 3X, X^{3}+X^{2}+2, and a bunch of others and it's returning correctly and accurately every time. I have yet to find a single issue where it said the pixel was on even though it wouldn't be etc. or other errors in earlier versions. I think it is error-free now. :)

Awesome. I will try it.

At long last, my original code

```
:"round(Y,0)=round(3x+6→Str1 //these are the functions, they are built in to the code (but it would not be hard to make them user-inputed)
:"round(Y,0)=round(-5x+17→Str2
...(more equasions)
:Prompt X
:Prompt Y
:sum(not(cumSum(1={expr(str0),expr(str1),expr(str2),expr(str3),expr(str4),expr(str5),expr(str6),expr(str7),expr(str8),expr(str9) //will return number of y-var that is responsible for point
```

Hmm and that took over a second to execute? It doesn't look too bad. Tell me if my code doesn't work, it comes with my lifetime warranty XD I see no reason why it shouldn't though. :)

It's only needed since the brackets are included.

`{(A/(abs(A)+not(A)))(abs(A)+Δx,A→L1`

Executes without errors, but having a bracket without the closing parenthesis throws an error since the closing grouping symbols didn't appear, either in the right order or at all.

Ah well, as long as it works who cares? XD

Keep in mind that this program will only work in ZoomStandard for the time being. It should be possible to create a program that will work no matter what the window, but I'm not quite sure what you would need to do to make that a reality.

Out of curiosity, why did you need a program that did this?