|
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. |
Draws a line at any angle.
Line(X1,Y1,X2,Y2[,erase,color,style])
Press:
- 2nd DRAW to enter the draw menu
- 2 to insert the Line( token, or use arrows and ENTER.
TI-83/84/+/SE
1 byte
The Line( command is used to draw lines at any angle, as opposed to only drawing vertical or horizontal lines. Line(X1,Y1,X2,Y2) will draw a line from (X1,Y1) to (X2,Y2). Line( is affected by the window settings, although you can use a friendly window so there is no impact on the command.
:Line(5,5,20,3)Advanced Uses
Line has an optional fifth argument. It can be any real number, but the default is one. If the fifth argument, erase, is something other than 0, then it will simply draw the line. If erase is 0, then it will erase the line.
:Line(5,5,20,3,0)Leave off the ending argument if you are just drawing the line.
:Line(5,5,20,3,1)
can be
:Line(5,5,20,3)The ending argument can be a formula, which is useful for movement applications and other things such as health bars where the lines drawn are constantly different. The following draws or erases a line depending on whether a key is pressed.
:getKey
:Line(5,5,20,3,not(AnsIf working on a TI 84+CSE or TI 84+CE, then the fifth argument of the Line( command can be a color name or ID number:
:Line(5,5,20,3,BROWNThe last argument, line style, is an optional argument that chooses what style of line to draw on the color calculators.
1 pixel wide line
:Line(5,5,20,3,RED,1
2 pixel wide line
:Line(5,5,20,3,RED,2
shaded above
:Line(5,5,20,3,RED,3
shaded below
:Line(5,5,20,3,RED,4Command Timings
If you are drawing horizontal or vertical lines that stretch the entire graph screen, such as a border, it is better to use Vertical or Horizontal. These are smaller and are usually faster as well.
Related Commands
See Also
.