Author Topic: Friendly window in Horiz mode  (Read 6082 times)

0 Members and 1 Guest are viewing this topic.

Offline JosJuice

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1344
  • Rating: +66/-14
    • View Profile
Re: Friendly window in Horiz mode
« Reply #15 on: November 11, 2010, 01:52:43 am »
How many times are you changing the Window settings in your program? Because if it's just once as the calculator goes into horizontal mode then I don't see any issue with it. Or are you saying for when you clear the screen each time you see the flicker and you want to get rid of that? I'm kinda confused about what you want and are doing.
Only when going into Horiz mode.
This is three bytes smaller ;)

Code: [Select]
ZStandard
84→Xmin
9→Ymax
ZInteger
0→Ymin
Horiz
Awesome! Now I just have to change the coordinates for stuff I'm drawing (shouldn't take more than a few minutes)... The window I used earlier was apparently 1 pixel off :P

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Friendly window in Horiz mode
« Reply #16 on: November 11, 2010, 05:37:00 pm »
Seems like it's solved, but

However, TI-BASIC Dev suggests this instead:
Code: [Select]
:ZStandard
:84→Xmin
:72→Ymax
:ZInteger
I don't understand what ZInteger does to create the window I want and why 84 and 72 are used instead of 94 and 62. I used this method for my programs anyway.

if you're still wondering, it goes like this:
First, ZStandard sets the coordinates to [-10,10] by [-10,10] (you probably know this).
Then it sets the Xmax and Ymax, which makes the screen [84,10] by [-10,72]. This seems impossible, and if you quit the program then and try to view the graph screen, it gives you an ERR:WINDOW RANGE, as expected. But since the program doesn't display the graph screen right then, you can still play around.
Finally, it runs ZInteger. All ZInteger really does is find the center of the graph and (while keeping it the center) zoom out so that each pixel represents one unit (in other words, ΔX and ΔY each equal 1). To do this, it finds the mean of 84 and 10 (which happens to be 47) and the mean of -10 and 72 (which happens to be 31). If you keep (47,31) the center, it zooms out nicely to [0,92]x[0,62] :)




Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: Friendly window in Horiz mode
« Reply #17 on: November 11, 2010, 07:00:47 pm »
oh, that's why you make it invalid.  Otherwise, you would have to store 104 to ymax.  Nice.