Question: Given two points p = (x1, y) and q = (x2, y2) any point on the line passing through the two points has coordinates: x

Given two points p = (x1, y) and q = (x2, y2) any point on the line passing through the two points has coordinates: x = x1 + t(x2 x1) y = yi + t(y2 y) where t is a real scalar value. In the module question2.py, write the function point_on_line (x1, yl, x2, y2, t) that returns a list of length 2 where the first element of the returned list is the value X in the equations above and the second element of the returned list is the value y in the equations above. You can assume that x1, yi, x2, y2, and t are all float values. Examples: x1 = 0 yl = 0 x2 = 1 4 y2 xy = point_on_line (x1, yl, x2, y2, 0) point_on_line (x1, yi, x2, y2, 1) point_on_1 on_line (x1, yi, x2, y2, 0.5) # [0, 0) # (1, 4) # [0.5, 2) half way between p and a
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
