def produit_scalaire(v1, v2): return sum(a*b for a, b in zip(v1, v2)) def trouver_intersection(plan, droite): a, b, c, d = plan x0, y0, z0, ad, bd, cd = droite vn = (a, b, c) # Vecteur normal vd = (ad, bd, cd) # Vecteur directeur if produit_scalaire(vn, vd) == 0: return "Pas d'intersection (droite parallèle)" t = (d - a*x0 - b*y0 - c*z0) / produit_scalaire(vn, vd) x = x0 + ad * t y = y0 + bd * t z = z0 + cd * t return (x, y, z) # Entrée des paramètres du plan print("Entrez les coefficients du plan :") a = float(input("a = ")) b = float(input("b = ")) c = float(input("c = ")) d = float(input("d = ")) plan = (a, b, c, d) # Entrée des paramètres de la droite print("Entrez les paramètres de la droite :") x0 = float(input("x0 = ")) y0 = float(input("y0 = ")) z0 = float(input("z0 = ")) ad = float(input("ad = ")) bd = float(input("bd = ")) cd = float(input("cd = ")) droite = (x0, y0, z0, ad, bd, cd) # Affichage du point d'intersection print("Point d'intersection :", trouver_intersection(plan, droite))