Radar Animation

We're glad you came by, but you might find what you're looking for elsewhere.

TI-Basic Developer is not the site it once was. While its information on commands and other calculator features remains almost second-to-none, its forum, archives, and even hosting service, Wikidot, have been decaying for years. The calculator community would love to see what you're working on, or help you in your next coding adventure, but TI-Basic Developer is no longer the place to do it.

Instead, you should head over to Cemetech (primarily American) or TI-Planet (primarily international). Both are active, well-established forums with their own archives, chatrooms, reference material, and abundant coding tools and resources. We'll see you there, we hope.

Radar.gif

Routine Summary

Displays a radar animation.

Inputs

None

Outputs

None

Variables Used

X, Y, S, T

Calculator Compatibility

TI-83/84/+/SE

Author

X1011

URL: United TI

Download

radar.zip

:ZStandard
:ZInteger
:For(X,-31,31
:Horizontal X
:End
:DelVar X31→Y
:Repeat getKey
:X→S:Y→T
:X+.1Ans→X
:Y-.1Ans→Y
:Line(0,0,X,Y,0
:Line(0,0,S,T
:End

In order to display the radar animation on the screen, we first need to create a friendly graphing window, setting the graph screen dimensions to X=-47…47 and Y=-31…31. We then make the entire screen black by drawing Horizontal lines from the bottom of the screen to the top.

Once the screen is setup, we initialize our two variables for the coordinates of the radar lines, and start drawing the radar animation on the screen. We store the two coordinates to two temporary variables, and then update the original variables to move the radar lines over a pixel. We then erase the old radar line from before, and draw the new radar line.

This gets repeated over and over again, until you press a key to quit. If you want the animation to last for a certain amount of time, you can replace the Repeat loop with a For( loop. In addition, you can use Shade(Ymin,Ymax instead of the For( loop at the beginning to shade the screen. This is smaller, although it isn't necessarily any faster.

.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Noncommercial 2.5 License.