y-at ( x point1 point2 -- y )


Vocabulary
ui.gadgets.charts.lines.private

Word description
Given two points on a straight line and an x coordinate, calculate the y coordinate at x on that line.

Inputs
xan object
point1an object
point2an object


Outputs
yan object


Examples
USING: ui.gadgets.charts.lines.private prettyprint ; 0 { 1 1 } { 5 5 } y-at .
0

USING: ui.gadgets.charts.lines.private prettyprint ; 3 { 0 5 } { 5 5 } y-at .
5

USING: ui.gadgets.charts.lines.private prettyprint ; 12 { 12 50 } { 15 15 } y-at .
50


See also
calc-line-slope, calc-x, calc-y

Definition