about | help | code help+videos | done | prefs |
Define a function that when passed the coordinates of two points (x1, y1) and (x2, y2) through which a line passes and another value (y3), returns the x-coordinate of the point on the line when y = y3. You may assume the line is not vertical (because then we'll need conditions). Just like the perimeter function (https://codingbat.com/prob/p244438), the complexity of this question is in the research and analysis, not the implementation. You may assume the x-coordinate corresponding to y3 is an integer. That is, the line passes through (x3, y3) where x3 and y3 are both integers. get_x(2, 6, 4, 12, 30) → 10 get_x(5, 4, 20, 5, 6) → 35 get_x(2, 6, 4, 12, -12) → -4 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Copyright Nick Parlante 2017 - privacy