Make a class for straight lines. Make a class Line whose constructor takes two points p1 and p2 (2- tuples or 2-lists) as input. The line goes through these two points (see function line in Chapter 3.1.7 for the relevant formula of the line). A value(x) method computes a value on the line at the point x. Here is a demo in an interactive session:
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here