Perpendicular Bisector Calculator

Perpendicular Bisector Calculator

Use this calculator to find the midpoint, the slope of the segment, the slope of the perpendicular bisector, and the equation of the perpendicular bisector for a line segment defined by two points (x1, y1) and (x2, y2).

Point 1 Coordinates





Point 2 Coordinates





Understanding the Perpendicular Bisector

A perpendicular bisector is a fundamental concept in geometry. For any given line segment, its perpendicular bisector is a line that satisfies two crucial conditions:

  1. It passes through the midpoint of the line segment.
  2. It is perpendicular to the line segment.

This means the perpendicular bisector forms a 90-degree angle with the original segment and divides the segment into two equal halves. Every point on the perpendicular bisector is equidistant from the two endpoints of the original line segment.

How to Calculate a Perpendicular Bisector

To find the perpendicular bisector of a line segment defined by two points, P1(x1, y1) and P2(x2, y2), we follow a series of steps:

Step 1: Find the Midpoint (M)

The midpoint of a line segment is the average of its coordinates. If the endpoints are (x1, y1) and (x2, y2), the midpoint (Mx, My) is calculated as:

Mx = (x1 + x2) / 2

My = (y1 + y2) / 2

Step 2: Find the Slope of the Line Segment (m_segment)

The slope of the line segment tells us its steepness. It's calculated as the change in y divided by the change in x:

m_segment = (y2 - y1) / (x2 - x1)

Special cases:

  • If x1 = x2 (a vertical line segment), the slope is undefined.
  • If y1 = y2 (a horizontal line segment), the slope is 0.

Step 3: Find the Slope of the Perpendicular Bisector (m_bisector)

Two lines are perpendicular if the product of their slopes is -1. Therefore, the slope of the perpendicular bisector is the negative reciprocal of the segment's slope:

m_bisector = -1 / m_segment

Special cases:

  • If m_segment is undefined (vertical segment), then m_bisector is 0 (a horizontal line).
  • If m_segment is 0 (horizontal segment), then m_bisector is undefined (a vertical line).

Step 4: Find the Equation of the Perpendicular Bisector

Using the point-slope form of a linear equation, y - y_point = m * (x - x_point), we can find the equation. We use the midpoint (Mx, My) as our point and m_bisector as our slope:

y - My = m_bisector * (x - Mx)

This can be rearranged into the slope-intercept form (y = mx + b) or standard form (Ax + By = C).

Special cases:

  • If m_bisector is undefined (vertical line), the equation is x = Mx.
  • If m_bisector is 0 (horizontal line), the equation is y = My.

Example Calculation

Let's find the perpendicular bisector for a segment with endpoints P1(1, 2) and P2(5, 6).

  1. Midpoint:
    • Mx = (1 + 5) / 2 = 3
    • My = (2 + 6) / 2 = 4
    • Midpoint = (3, 4)
  2. Slope of Segment:
    • m_segment = (6 – 2) / (5 – 1) = 4 / 4 = 1
  3. Slope of Perpendicular Bisector:
    • m_bisector = -1 / 1 = -1
  4. Equation of Perpendicular Bisector:
    • Using point-slope form: y – 4 = -1 * (x – 3)
    • y – 4 = -x + 3
    • y = -x + 7

The perpendicular bisector for the segment P1(1, 2) to P2(5, 6) is y = -x + 7.

.perpendicular-bisector-calculator { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; max-width: 700px; margin: 20px auto; padding: 25px; background: #f9f9f9; border-radius: 10px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); border: 1px solid #ddd; } .perpendicular-bisector-calculator h2 { color: #333; text-align: center; margin-bottom: 20px; font-size: 1.8em; } .perpendicular-bisector-calculator h3 { color: #555; margin-top: 25px; margin-bottom: 15px; font-size: 1.3em; } .perpendicular-bisector-calculator p { color: #666; line-height: 1.6; margin-bottom: 10px; } .calculator-inputs label { display: inline-block; margin-bottom: 8px; font-weight: bold; color: #444; width: 120px; } .calculator-inputs input[type="number"] { width: calc(100% – 140px); padding: 10px; margin-bottom: 15px; border: 1px solid #ccc; border-radius: 5px; box-sizing: border-box; font-size: 1em; } .calculator-inputs button { display: block; width: 100%; padding: 12px 20px; background-color: #007bff; color: white; border: none; border-radius: 5px; font-size: 1.1em; cursor: pointer; transition: background-color 0.3s ease; margin-top: 20px; } .calculator-inputs button:hover { background-color: #0056b3; } .calculator-results { margin-top: 30px; padding: 20px; background-color: #e9f7ef; border: 1px solid #d4edda; border-radius: 8px; color: #155724; font-size: 1.1em; line-height: 1.8; } .calculator-results strong { color: #0a3622; } .calculator-results p { margin-bottom: 8px; } .calculator-article { margin-top: 40px; padding-top: 20px; border-top: 1px solid #eee; } .calculator-article h2 { font-size: 1.6em; color: #333; margin-bottom: 15px; text-align: left; } .calculator-article h4 { font-size: 1.2em; color: #444; margin-top: 20px; margin-bottom: 10px; } .calculator-article ul, .calculator-article ol { margin-left: 20px; margin-bottom: 15px; color: #666; } .calculator-article li { margin-bottom: 5px; } .calculator-article code { background-color: #eef; padding: 2px 5px; border-radius: 3px; font-family: 'Courier New', Courier, monospace; color: #c7254e; } function calculatePerpendicularBisector() { var x1 = parseFloat(document.getElementById("x1").value); var y1 = parseFloat(document.getElementById("y1").value); var x2 = parseFloat(document.getElementById("x2").value); var y2 = parseFloat(document.getElementById("y2").value); var resultDiv = document.getElementById("result"); resultDiv.innerHTML = ""; // Clear previous results if (isNaN(x1) || isNaN(y1) || isNaN(x2) || isNaN(y2)) { resultDiv.innerHTML = "Please enter valid numbers for all coordinates."; return; } var mx, my; // Midpoint coordinates var m_segment; // Slope of the segment var m_bisector; // Slope of the perpendicular bisector var equation = ""; // Equation of the perpendicular bisector var m_segment_str = ""; var m_bisector_str = ""; // Step 1: Calculate Midpoint mx = (x1 + x2) / 2; my = (y1 + y2) / 2; // Step 2 & 3 & 4: Calculate Slopes and Equation, handling edge cases if (x1 === x2) { // Vertical segment m_segment_str = "undefined (vertical line)"; m_bisector = 0; // Perpendicular bisector is horizontal m_bisector_str = "0 (horizontal line)"; equation = "x = " + mx.toFixed(4); // This is wrong, it should be y = My for horizontal line equation = "y = " + my.toFixed(4); // Corrected for horizontal bisector } else if (y1 === y2) { // Horizontal segment m_segment = 0; m_segment_str = "0 (horizontal line)"; m_bisector_str = "undefined (vertical line)"; // Perpendicular bisector is vertical equation = "x = " + mx.toFixed(4); // Corrected for vertical bisector } else { // General case m_segment = (y2 – y1) / (x2 – x1); m_segment_str = m_segment.toFixed(4); m_bisector = -1 / m_segment; m_bisector_str = m_bisector.toFixed(4); // Equation: y – my = m_bisector * (x – mx) // y = m_bisector * x – m_bisector * mx + my var b = my – (m_bisector * mx); equation = "y = " + m_bisector.toFixed(4) + "x "; if (b >= 0) { equation += "+ " + b.toFixed(4); } else { equation += "- " + Math.abs(b).toFixed(4); } } // Display results var resultsHTML = "

Calculation Results:

"; resultsHTML += "Midpoint (Mx, My): (" + mx.toFixed(4) + ", " + my.toFixed(4) + ")"; resultsHTML += "Slope of Segment: " + m_segment_str + ""; resultsHTML += "Slope of Perpendicular Bisector: " + m_bisector_str + ""; resultsHTML += "Equation of Perpendicular Bisector: " + equation + ""; resultDiv.innerHTML = resultsHTML; } // Calculate on page load with default values window.onload = calculatePerpendicularBisector;

Leave a Reply

Your email address will not be published. Required fields are marked *