<ray>

<ray> is a Graphical component that renders a geometrical ray (one endpoint; the opposite side continuous), when nested inside a <graph>.

A <ray> may be specified with:

  1. the endpoint and the through attributes
  2. the endpoint and the direction attributes

Attributes and Properties

Attributes for <ray>
AttributeTypeValues
applyStyleToLabel = "…"boolean"true" "false"
direction = "…"[ math ]
displayDecimals = "…"integer
displayDigits = "…"integer
displaySmallAsZero = "…"number
draggable = "…"boolean"true" "false"
endpoint = "…"[ math ]
labelIsName = "…"boolean"true" "false"
layer = "…"integer
padZeros = "…"boolean"true" "false"
through = "…"[ math ]
Props for <ray name="r">
PropertyType
$r.applyStyleToLabelboolean
$r.direction[ math ]
$r.disabledboolean
$r.displayDecimalsinteger
$r.displayDigitsinteger
$r.displaySmallAsZeronumber
$r.draggableboolean
$r.endpoint[ math ]
$r.fixedboolean
$r.fixLocationboolean
$r.hiddenboolean
$r.labellabel
$r.labelIsNameboolean
$r.layerinteger
$r.numDimensionsnumber
$r.padZerosboolean
$r.styleDescriptiontext
$r.styleDescriptionWithNountext
$r.through[ math ]

Example: <ray> defined directly

The <ray> component is defined directly by specifying coordinates within the endpoint and through attributes. (Alternatively, a tuple may be directly specified in the direction attribute).

The user can manipulate the position of the ray by dragging the ray itself, but the direction remains constant.


Example: <ray> defined with rendered through-point

The <ray> component is used with the endpoint and through attributes. Note that, if no endpoint is specified, the default is (0,0)(0,0).

The user can manipulate both the direction and the endpoint of the <ray> by dragging the points.


Example: <ray> defined with endpoint and direction

If both the through and direction attributes are specified and not consistent, Doenet prioritizes the direction.


Example: Adjust direction of a <ray>

If the direction attribute references another component, such as a <vector> or a <mathInput/>, the user can manipulate the direction of the line segment.