Question: Create a class called Line that has the following attributes: Line slope - Double yIntersect - Double Line() Line(x_one, y_one, x_two, y_two) getSlope() - Double
| Line |
| slope - Double |
| yIntersect - Double |
| Line() |
| Line(x_one, y_one, x_two, y_two) |
| getSlope() - Double |
| getYIntersect() - Double |
| isPointOnLine(xValue, yValue) - Boolean |
| toString() - String |
Notes:
Your isPointOnLine() method should return true if a given point falls on the given line. In all other cases, return false.
then:
Create a class called Point that has the following attributes:
| Point |
| xValue- Double |
| yValue- Double |
| Point() |
| Point(xValue, yValue) |
| getXValue() - Double |
| getYValue() - Double |
| toString() - String |
then:
Create a class called LineSegment that has the following attributes:
| LineSegment |
| slopeIntercept - Line |
| startXValue - Double |
| endXValue - Double |
| LineSegment () |
| LineSegment (slopeIntercept, startXValue, endXValue) |
| getSlope() - Double |
| getLength() - Double |
| isPointOnLine(Point) - Boolean |
| toString() - String |
Notes:
You should use standard calculations to return slope and length. Both of these values should be accurate to 4 decimal places.
The method isPointOnLine(Point) will accept a point and return true if it falls on the line segment, and false otherwise.
Step by Step Solution
There are 3 Steps involved in it
Heres the implementation of the three classes in Java import javatextDecimalFormat class Line privat... View full answer
Get step-by-step solutions from verified subject matter experts
