# Line: r(t) = [1 + 2t, 2 + t, 3 + 4t]
x, y, z, t = symbols('x y z t')
line = [1 + 2*t, 2 + t, 3 + 4*t]
# Plane: 2x - y + 4z - 10 = 0
plane_eq = Eq(2*line[0] - line[1] + 4*line[2] - 10, 0)
t_val = solve(plane_eq, t)[0]
intersection = [coord.subs(t, t_val) for coord in line]
print("Intersection point:", intersection)
Intersection point: [15/19, 36/19, 49/19]
point = np.array([2, 3, 4])
normal = np.array([2, -1, 4])
d = -10 # from plane equation: 2x - y + 4z - 10 = 0 → d = -10
numerator = abs(np.dot(normal, point) + d)
denominator = np.linalg.norm(normal)
distance = numerator / denominator
print("Distance from point to plane:", distance)
Distance from point to plane: 1.5275252316519468
d = np.array([1, 1, 0]) # direction vector of line
n = np.array([0, 0, 1]) # normal vector of plane
sin_theta = abs(np.dot(d, n)) / (np.linalg.norm(d) * np.linalg.norm(n))
theta_rad = np.arcsin(sin_theta)
theta_deg = np.degrees(theta_rad)
print("Angle between line and plane (degrees):", theta_deg)
Angle between line and plane (degrees): 0.0
x, y, z = symbols('x y z')
# Two planes:
eq1 = Eq(2*x + y - z, 5)
eq2 = Eq(x - y + 2*z, 3)
sol = solve([eq1, eq2], (x, y), dict=True)
print("Intersection in parametric form:")
print(sol)