2-point-chunk ( left right ymin ymax -- chunk )


Vocabulary
ui.gadgets.charts.lines.private

Inputs
leftan object
rightan object
yminan object
ymaxan object


Outputs
chunkan object


Definition


:: 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 ;