Create a class called Line that has the following attributes: Line slope - Double yIntersect - Double
Fantastic news! We've Found the answer you've been seeking!
Question:
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.
Related Book For
Java How To Program Late Objects Version
ISBN: 9780136123712
8th Edition
Authors: Paul Deitel, Deitel & Associates
Posted Date: