Handbook
Glossary
2-point-chunk ( left right ymin ymax -- chunk )
Vocabulary
ui
.
gadgets
.
charts
.
lines
.
private
Inputs
left
an
object
right
an
object
ymin
an
object
ymax
an
object
Outputs
chunk
an
object
Definition
USING:
arrays
kernel
math
sequences
;
IN:
ui.gadgets.charts.lines.private
::
2-point-chunk
( left right ymin ymax -- chunk )
left
last
:>
left-point right
first
:>
right-point
left-point
x
right-point
x
=
[
left-point
x
ymin ymax
xyy>chunk
]
[
left-point right-point
calc-line-slope
:>
slope slope ymin left-point
calc-point-y
slope ymax left-point
calc-point-y
left-point
y
right-point
y
>
[
swap
]
when
2array
]
if
;