Design the class linetype to store aline to store a line


The equation of a line in standard form is ax + by ¼ c, wherein both a and b cannot be zero, and a, b, and c are real numbers. If b 6¼ 0, then -a/b is theslope of the line. If a ¼ 0, then it is a horizontal line, and if b ¼ 0, then it isa vertical line. The slope of a vertical line is undefined. Two lines areparallel if they have the same slope or both are vertical lines. Two lines areperpendicular if either one of the lines is horizontal and the other is verticalor the product of their slopes is -

1. Design the class lineType to store aline. To store a line, you need to store the values of a (coefficient of x), b(coefficient of y), and c. Your class must contain the following operations.

a. If a line is nonvertical, then determine its slope.

b. Determine if two lines are equal. (Two lines a1x + b1y ¼ c1 and a2x +b2y ¼ c2 are equal if either a1¼ a2, b1¼ b2, and c1¼ c2 or a1¼ ka2,b1¼ kb2, and c1¼ kc2 for some real number k.)

c. Determine if two lines are parallel.

d. Determine if two lines are perpendicular.

e. If two lines are not parallel, then find the point of intersection.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Design the class linetype to store aline to store a line
Reference No:- TGS01174382

Now Priced at $50 (50% Discount)

Recommended (90%)

Rated (4.3/5)

A

Anonymous user

4/18/2016 5:05:23 AM

Display your answer with all aspects assessment as well describe to slope or both are vertical lines The equation of a line in standard form is ax + by ¼ c, wherein both a and b cannot be zero, and a, b, and c are real numbers. If b 6¼ 0, then -a/b is the slope of the line. If a ¼ 0, then it is a horizontal line, and if b ¼ 0, then it is a vertical line. The slope of a vertical line is undefined. Two lines are parallel if they have the same slope or both are vertical lines. Two lines are perpendicular if either one of the lines is horizontal or the other is vertical or the product of their slopes is - 1. Design the class line Type to store a line. To store a line, you need to store the values of a (coefficient of x), b (coefficient of y), and c. Your class must contain the following operations. a. If a line is non vertical, then determine its slope.