k = (y₂ − y₁) / (x₂ − x₁)

Compute a line slope, inclination angle and intercept from two points.

📐 计算公式
两点连线斜率与倾角(本页代码口径):斜率 k=(y₂−y₁)÷(x₂−x₁);标准倾角 θ=arctan(k)×180÷π,负值加 180°,落在 0°–180°。校验:四个坐标必须填写且为有限数值,非数字或无穷不按 0 兜底;只有 x₂ 与 x₁ 严格相等才分竖直线/重合点,不用 |dx| 阈值判竖直。判据:无固定分级;k>0 上行、k<0 下行、k=0 水平(0°),竖直线倾角 90°,两点重合则斜率与倾角不唯一。

由两点坐标求直线斜率。

Formula & Standard References

Item Formula / Note Source / Standard
Slope k = (y2 - y1)/(x2 - x1), provided x1 ≠ x2 ISO 80000-2:2019, Quantities and units - Part 2: Mathematics
Relation to the inclination angle k = tan(theta), where theta is the inclination from the positive x-axis ISO 80000-2:2019, Quantities and units - Part 2: Mathematics
Parallel and perpendicular Parallel lines have k1 = k2; perpendicular lines have k1 · k2 = -1 Descartes R., La Geometrie (1637)
Point-slope form y - y1 = k · (x - x1) ISO 80000-2:2019, Quantities and units - Part 2: Mathematics
📌 计算说明
  • (1,2)→(4,8) 斜率 2。
  • 分母为零为竖直线。