Question: In C++: In plane analytic geometry we can represent a line by the equation y = mx + b where m is called the slope
In C++:
In plane analytic geometry we can represent a line by the equation y = m"x + b where m is called the slope and is a real number representing the inclination of the line in relation to the horizontal axis and b is called the y-intercept which is the location where the line crosses the vertical axis. This is to say that any line will be determined by it's two attributes m and b Create a class named line that represent lines in two dimensional planes that has the following properties 1. It contains two double variables m and b representing the slop and the y-intercept as instance variables 2. It includes a default constructor that initialize m and b to 0 3. It include a constructor that requires two arguments one for m and one for b with default value of 0 4 It include a method to translate (move) the line up or down the y-axis (vertical axis) with the new b becoming btranslation where translation is the amount by which the line is moved up or down but the slope remains the same
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
