Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A line can be defined by two points, p_1: (x_1,y_1) and p_2: (x_2,y_2). The slope of the line can be determined by (6y_2-y_1))/((x_2-x_1)) , given

image text in transcribed
A line can be defined by two points, p_1: (x_1,y_1) and p_2: (x_2,y_2). The slope of the line can be determined by (6y_2-y_1))/((x_2-x_1)) , given that x_2-x_1 +0. If y_2-y_1=0, then it is a horizontal line, and if x_2-x_1, 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 one of the lines is horizontal and another is vertical, or if the product of their slopes is -1. Design the class line Type to store a line. To store a line, you need to store two Point objects. Your class must contain the following operations: If a line is nonvertical, then determine its slope. Determine if two lines are equal. Determine if two lines are parallel. Determine if two lines are perpendicular. Add appropriate constructors to initialize variables of line Type. Also write a program to test your class. 480 words English (United States

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems Second East European Symposium Adbis 98 Poznan Poland September 1998 Proceedings Lncs 1475

Authors: Witold Litwin ,Tadeusz Morzy ,Gottfried Vossen

1st Edition

3540649247, 978-3540649243

More Books

Students also viewed these Databases questions