Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 sameStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started