I have two points, x2 and x1. I have their corresponding y’s, y2 and y1.
I always know that x2>.95>x1 and that y2>y1.
so i wrote this code, in the hopes that I can basically find where along y1-y2 that .95 occurs, however I am not sure towards its accurancy, so any suggestions or notices would be nice:
3 x1 = float(raw_input('x1: '))
4 x2 = float(raw_input('x2: '))
5 y1 = float(raw_input('y1: '))
6 y2 = float(raw_input('y2: '))
7
8 z = 0.95
9
10 dist = x2-x1
11
12 yi = ((1-(.01*(dist/(dist-(x2-z)))))*(y2-y1))+y1
please let me know if this is right, because I am not sure it is, but I am also not sure what I am missing.
The equation of a line is
y = mx + cwheremis the slope, andcis the intercept.Given
(x1, y1)and(x2, y2), you can findmandc:Now that you know those, you can find the value of
ywhenx = 0.95, by: