# Tính độ dốc, khoảng cách và trung điểm

> Tìm khoảng cách, trung điểm, hệ số góc, phương trình đường thẳng dạng hệ số góc-tung độ gốc, tổng quát, điểm-hệ số góc và giao điểm hai đường thẳng.

Phiên bản tương tác: https://www.calcopenly.com/vi/geometry/coordinate-geometry-calculator
Chủ đề: Máy tính hình học

Enter two points to get the straight-line distance d = √((x₂ − x₁)² + (y₂ − y₁)²), the midpoint ((x₁ + x₂)/2, (y₁ + y₂)/2) and the slope m = (y₂ − y₁)/(x₂ − x₁). The line through them is written in slope-intercept form y = mx + b, in standard form Ax + By = C with whole-number coefficients and in point-slope form, alongside its perpendicular bisector. Fractions stay exact, so a slope of 4/3 is not rounded to 1.3333.

The default points (1, 2) and (4, 6) are 5 apart, a 3-4-5 triangle, with midpoint (2.5, 4) and line y = (4/3)x + 2/3. Switching on a second line adds whether the two are parallel, perpendicular or intersecting, the angle between them and the crossing point.

A vertical line has no slope, so only its standard form, such as x = 3, is given. Coordinates carry no unit: the distance is in whatever unit they use.

## Dữ liệu đầu vào

- **Point 1: x**
- **Point 1: y**
- **Point 2: x**
- **Point 2: y**
- **Compare with a second line**
- **Line 2, point 3: x**
- **Line 2, point 3: y**
- **Line 2, point 4: x**
- **Line 2, point 4: y**

## Kết quả

- Distance P₁P₂ — kết quả chính
- Midpoint x
- Midpoint y
- Slope
- Angle of inclination (°)
- Slope-intercept form
- Standard form
- Point-slope form
- Perpendicular bisector
- Line 2
- The lines are
- Angle between the lines (°)
- Intersection x
- Intersection y

## Công thức

$$
d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2},\quad M = \left(\tfrac{x_1 + x_2}{2}, \tfrac{y_1 + y_2}{2}\right),\quad m = \frac{y_2 - y_1}{x_2 - x_1},\quad \tan\theta = \left|\frac{m_2 - m_1}{1 + m_1 m_2}\right|
$$

## Ví dụ có lời giải

### P₁(1, 2) and P₂(4, 6)

- Point 1: x: 1
- Point 1: y: 2
- Point 2: x: 4
- Point 2: y: 6
- **Distance P₁P₂: 5**
- **Midpoint x: 2.5**
- **Midpoint y: 4**
- **Slope: 1.33333333**
- **Angle of inclination: 53.130102 °**
- **Slope-intercept form: y = (4/3)x + 2/3**
- **Standard form: 4x − 3y = −2**
- **Point-slope form: y − 2 = (4/3)(x − 1)**
- **Perpendicular bisector: y = −0.75x + 5.875**
- Nguồn đối chiếu: Python 3.8 fractions: dx = 3, dy = 4 (3-4-5), m = 4/3, b = 2 − 4/3 = 2/3; bisector through (5/2, 4) with slope −3/4 has b = 47/8 = 5.875 (terminating fractions print as decimals); math.degrees(atan(4/3))

### Vertical line (edge case: no slope)

- Point 1: x: 3
- Point 1: y: 1
- Point 2: x: 3
- Point 2: y: 7
- **Distance P₁P₂: 6**
- **Standard form: x = 3**
- **Angle of inclination: 90 °**
- **Perpendicular bisector: y = 4**
- **Midpoint y: 4**
- Nguồn đối chiếu: Equal x-coordinates: the line x = 3 is vertical; the bisector is the horizontal line through (3, 4)

### Decimal coordinates

- Point 1: x: -1.5
- Point 1: y: 2.25
- Point 2: x: 3.5
- Point 2: y: -0.75
- **Distance P₁P₂: 5.83095189**
- **Slope: -0.6**
- **Slope-intercept form: y = −0.6x + 1.35**
- **Standard form: 12x + 20y = 27**
- Nguồn đối chiếu: Python 3.8 fractions: dx = 5, dy = −3, √34; −3x − 5y = −27/4 scaled by −4

### Two intersecting lines

- Point 1: x: 1
- Point 1: y: 2
- Point 2: x: 4
- Point 2: y: 6
- Compare with a second line: có
- Line 2, point 3: x: 0
- Line 2, point 3: y: 6
- Line 2, point 4: x: 6
- Line 2, point 4: y: 0
- **The lines are: Intersecting**
- **Angle between the lines: 81.869898 °**
- **Intersection x: 2.28571429**
- **Intersection y: 3.71428571**
- **Line 2: y = −x + 6**
- Nguồn đối chiếu: tan θ = |(−1 − 4/3)/(1 − 4/3)| = 7, Python 3.8 math.degrees(atan(7)); intersection (16/7, 26/7) by Python fractions

### Perpendicular lines

- Point 1: x: 0
- Point 1: y: 0
- Point 2: x: 2
- Point 2: y: 1
- Compare with a second line: có
- Line 2, point 3: x: 0
- Line 2, point 3: y: 5
- Line 2, point 4: x: 1
- Line 2, point 4: y: 3
- **The lines are: Perpendicular**
- **Angle between the lines: 90 °**
- **Intersection x: 2**
- **Intersection y: 1**
- Nguồn đối chiếu: Slopes 1/2 and −2 multiply to −1; y = x/2 meets y = 5 − 2x at x = 2

### Parallel lines (edge case: no intersection)

- Point 1: x: 0
- Point 1: y: 0
- Point 2: x: 1
- Point 2: y: 1
- Compare with a second line: có
- Line 2, point 3: x: 0
- Line 2, point 3: y: 1
- Line 2, point 4: x: 2
- Line 2, point 4: y: 3
- **The lines are: Parallel**
- **Angle between the lines: 0 °**
- Nguồn đối chiếu: Both slopes are 1 with different intercepts (0 and 1)

## Câu hỏi

### How do you find the slope between two points?

Divide the change in y by the change in x: m = (y₂ − y₁)/(x₂ − x₁). From (1, 2) to (4, 6) the rise is 4 and the run is 3, so m = 4/3 ≈ 1.3333. A positive slope rises to the right, a negative one falls, 0 is horizontal, and when x₂ = x₁ the line is vertical and the slope is undefined.

### What is the distance formula?

d = √((x₂ − x₁)² + (y₂ − y₁)²), which is Pythagoras' theorem applied to the horizontal and vertical gaps. Between (1, 2) and (4, 6) the gaps are 3 and 4, so d = √25 = 5. For points given as latitude and longitude use a great-circle formula instead, because the flat formula ignores the Earth's curvature.

### How do you find the equation of a line through two points?

Find the slope m, then the intercept b = y₁ − m·x₁, and write y = mx + b. Through (1, 2) and (4, 6), m = 4/3 and b = 2 − 4/3 = 2/3, so y = (4/3)x + 2/3. Multiplying by 3 and rearranging gives the standard form 4x − 3y = −2, with whole-number coefficients.

### How do you tell if two lines are parallel or perpendicular?

Compare their slopes. Parallel lines have equal slopes, and perpendicular lines have slopes whose product is −1, such as 1/2 and −2. Any other pair crosses at an angle θ with tan θ = |(m₂ − m₁)/(1 + m₁m₂)|: slopes of 4/3 and −1 give tan θ = 7, so the lines meet at 81.87°.

### What is a perpendicular bisector?

The line through the midpoint of a segment at right angles to it; every point on it is equally far from both endpoints. For (1, 2) and (4, 6) it passes through (2.5, 4) with slope −3/4, the negative reciprocal of 4/3, giving y = −0.75x + 5.875. The bisectors of a triangle's three sides meet at the centre of its circumscribed circle.

### “Tính độ dốc, khoảng cách và trung điểm” chính xác đến mức nào?

Độ chính xác phụ thuộc vào dữ liệu nhập và giả định của phương pháp. Phép tính thập phân dùng 50 chữ số có nghĩa, nhưng ước lượng, phương pháp số và dữ liệu nguồn có thể kém chính xác hơn; làm tròn khi hiển thị không loại bỏ các giới hạn đó. Ví dụ có lời giải đã đối chiếu với nguồn độc lập: 6. Ví dụ, “P₁(1, 2) and P₂(4, 6)” được kiểm tra bằng Python 3.8 fractions: dx = 3, dy = 4 (3-4-5), m = 4/3, b = 2 − 4/3 = 2/3; bisector through (5/2, 4) with slope −3/4 has b = 47/8 = 5.875 (terminating fractions print as decimals); math.degrees(atan(4/3)).

### Phương pháp này lấy từ đâu?

OpenStax College Algebra 2e, §2.1 (distance and midpoint formulas) and §2.2 (equations of lines); Weisstein, E. W. “Line”, “Perpendicular Bisector” — MathWorld.

## Nguồn

- [OpenStax College Algebra 2e, §2.1 (distance and midpoint formulas) and §2.2 (equations of lines)](https://openstax.org/books/college-algebra-2e/pages/2-1-the-rectangular-coordinate-systems-and-graphs)
- [Weisstein, E. W. “Line”, “Perpendicular Bisector” — MathWorld](https://mathworld.wolfram.com/PerpendicularBisector.html)
