|
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. |
Shades in a circle.
R - the radius of the circle
A - the X coordinate of the circle's center
B - the Y coordinate of the circle's center
None
N, R, A, B
TI-83/84/+/SE
Jutt
URL: United TI
:For(N,0,R,ΔX
:√(R²-N²
:Line(A+N,B-Ans,A+N,B+Ans
:Line(A-N,B-Ans,A-N,B+Ans
:EndAlthough it is possible to shade in a circle using the Shade( command (i.e., Shade(-√(R²-(X-A)²)+B,√(R²-(X-A)²)+B)), that is actually quite impractical in a real program because of its slow speed. Fortunately, you can improve upon that by using your own routine.
When graphing a circle, there are a few main things you need to know: the radius and the (X,Y) coordinates of the center. In our routine, the R variable is the radius, the A variable is the circle's X coordinate and the B variable is the circle's Y coordinate.
Rather than displaying the circle as one big circle, we are going to display it line by line using a For( loop, starting from the center. The √(R²-N² formula is based on the circle formula R2=(X–H)2+(Y–K)2, with the formula rearranged to get the respective part of the circle.
The circle should display pretty quickly, but it all depends on the values that you chose for the variables; smaller values will be faster, and likewise larger values will be slower. In addition, the circle may not display correctly if you don't have the right graph settings, so you should set your calculator to a friendly graphing window.
.