Skip to content
Property Value
Hex Value $9C
Categories
Localizations
  • FR: Ligne(

Line(

Overview

Draws a line from (X1,Y1) to (X2,Y2) with the following options: erase #: 1,0, color #: 10-24, and line style #: 1-4.

Availability: Token available everywhere.

Syntax

Line(X1,Y1,X2,Y2[,erase#,color#,linestyle#])

Arguments

NameTypeOptional
X1
Y1
X2
Y2
erase#Yes
color#colorNumYes
linestyle#integerYes

Location

2nd, draw, DRAW, 2:Line(


Overview

Erases a line (erase #: 1,0) from (X1,Y1) to (X2,Y2).

Availability: Token available everywhere.

Syntax

Line(X1,Y1,X2,Y2,0[,line#])

Arguments

NameTypeOptional
X1
Y1
X2
Y2
line#Yes

Location

2nd, draw, DRAW, 2:Line(


Description

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(Ans

If 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,BROWN

The 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,4

Command 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.

See Also


Source: parts of this page were written by the following TI|BD contributors: basickevin, burr, DarkerLine, GoVegan, kg583, Lionel Foxcroft, Weregoose, Xphoenix.

History

Calculator OS Version Description
TI-82 1.0 Added

Last update: September 30, 2023 15:38:51
Created: February 23, 2023 23:15:01
Authors: Adrien Bertrand