Write a program for finding the equation of a Line Given Two End Points (x1, y1) and (x2, y2) The equation for a line is Y = MX + C Where M = Slope of a Line and C = Intercept To Find the slope of a line slope = (y2 - y1)/(x2-x1) To Find the intercept of the line, intercept = y1 - (slope) * x1 which would be same as, intercept = y2 - (slope) * x2 Sample Output: Program to find the equation of a line given two endpoints:
Write a program for finding the equation of a Line Given Two End Points (x1, y1) and (x2, y2) The equation for a line is Y = MX + C Where M = Slope of a Line and C = Intercept To Find the slope of a line slope = (y2 - y1)/(x2-x1) To Find the intercept of the line, intercept = y1 - (slope) * x1 which would be same as, intercept = y2 - (slope) * x2 Sample Output: Program to find the equation of a line given two endpoints:
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 21PE
Related questions
Question
Swift
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L