<line>
<line>
is a Graphical
component that renders a line when nested inside a <graph>
component, and renders an equation otherwise.
Current functionality supports generation of lines in through user-specification of:
- a single pair of points
- through a single point and a specified slope
- with an equation, or
<function>
Attributes and Properties
Attribute | Type | Values |
---|---|---|
applyStyleToLabel = "…" | boolean | "true" "false" |
displayDecimals = "…" | integer | |
displayDigits = "…" | integer | |
displaySmallAsZero = "…" | number | |
draggable = "…" | boolean | "true" "false" |
equation = "…" | math | |
labelIsName = "…" | boolean | "true" "false" |
labelPosition = "…" | text | "upperright" "upperleft" "lowerright" "lowerleft" |
layer = "…" | integer | |
padZeros = "…" | boolean | "true" "false" |
parallelTo = "…" | ||
perpendicularTo = "…" | ||
slope = "…" | math | |
through = "…" | ||
variables = "…" | [ _variableName ] |
Property | Type |
---|---|
$l.applyStyleToLabel | boolean |
$l.backgroundColor | text |
$l.coeff0 | math |
$l.coeffvar1 | math |
$l.coeffvar2 | math |
$l.disabled | boolean |
$l.displayDecimals | integer |
$l.displayDigits | integer |
$l.displaySmallAsZero | number |
$l.draggable | boolean |
$l.equation | math |
$l.fixed | boolean |
$l.fixLocation | boolean |
$l.hidden | boolean |
$l.label | label |
$l.labelIsName | boolean |
$l.labelPosition | text |
$l.latex | latex |
$l.layer | integer |
$l.numDimensions | number |
$l.padZeros | boolean |
$l.points | [ math ] |
$l.slope | math |
$l.styleDescription | text |
$l.styleDescriptionWithNoun | text |
$l.text | text |
$l.textColor | text |
$l.textStyleDescription | text |
$l.variables | [ _variableName ] |
$l.xintercept | math |
$l.yintercept | math |
Example: Default <line>
The default <line>
without any attributes specified (other than a styleNumber
) is
illustrated. This line is not very interesting; it is just the -axis. The equation of the line is
copied below the <graph>
. You can click and drag the line to see this equation updated.
Example: <line>
with slope and through point
Two lines are graphed using both the slope
and through
attributes.
Example: <line>
through 2 points
Two lines are graphed by specifying two through points using the through
attribute.
Example: <line>
by equation
Two lines are graphed by providing their equations directly.
Example: Line as a <function>
Two lines are defined using the <function>
component. This
is a useful alternative to defining a line with the <line>
component if
the function needs to be evaluated at different input values.
Attribute Example: through
Two lines are graphed by specifying two through points using the through
attribute.
Attribute Example: slope
If only the slope
attribute is specified, the -intercept defaults to .
Attribute Example: equation
The equation
attribute takes any linear expression in and , unless the variables
attribute is also employed.
Attribute Example: variables
The variables
attribute allows customization of the independent and dependent variable names.
Attribute Example: Standard graphical attributes
The uses of the following standard graphical attributes are
illustrated: hide
, draggable
, layer
, styleNumber
, applyStyleToLabel
and labelIsName
.
Property Example: Attributes as properties
The above listed attributes of a named <line>
are also available as properties.
Property Example: points
The points
property of a named <line>
returns the through points of the line in an array.
Property Example: xIntercept, yIntercept
The xIntercept
and yIntercept
properties return the intercepts of the named <line>
.
Property Example: coeff0, coeffVar1, coeffVar2
Linear coefficients corresponding to the linear form
can be obtained with the above properties, where coeff0
, coeffVar2
and coeffVar1
.
Property Example: latex
The latex
property renders the latex code for rendering the equation of the line.