# Given two coordinates, Print the line equation

**Objective: **Given two coordinates (x1, y1) and (x2, y2). Write a java program to construct a line equation that passes through the given coordinates.

**Line Equation:**

Given two coordinates (x1, y1) and (x2, y2) the line equation iswhere m is the slope of the line, wherey - y1 = m(x - x1)slope = (y2-y1)/(x2-x1)

**Example:**

Given coordinates: [3,7] and [5,11] Line Equation: y = 2x + 1 Given coordinates: [2,2] and [4,12] Line Equation: y = 5x -8

**Complete Code:**

**Output:**

Given coordinates: [2,2] and [4,12] Line Equation: y = +5x -8