Loading text...
Code Executed
Code:
import sympy
x1, y1 = 2, 4
x2, y2 = 6, 8
midpoint_x = (x1 + x2) / 2
midpoint_y = (y1 + y2) / 2
slope_ab = (y2 - y1) / (x2 - x1)
perp_slope = -1 / slope_ab
x, y = sympy.symbols('x y')
line_eq = sympy.Eq(y - midpoint_y, perp_slope * (x - midpoint_x))
simplified_eq = sympy.simplify(line_eq)
print(f"Midpoint: ({midpoint_x}, {midpoint_y})")
print(f"Slope AB: {slope_ab}")
print(f"Perpendicular Slope: {perp_slope}")
print(f"Equation: {simplified_eq}")
Output:
Midpoint: (4.0, 6.0) Slope AB: 1.0 Perpendicular Slope: -1.0 Equation: Eq(1.0*x + 1.0*y, 10.0)
STEP 1 • VERIFIED
Loading text...
VIEW STEPS
STEP 2 • VERIFIED
Loading text...
VIEW STEPS
STEP 3 • VERIFIED
Loading text...
VIEW STEPS
STEP 4 • VERIFIED
Loading text...
VIEW STEPS
Have a Math Question?
Ask your own question to get a step-by-step verified solution instantly.
Ask a Question