def colineaire(u1, u2):
if u1[0]/u2[0] == u1[1]/u2[1] and u1[0]/u2[0] == u1[2]/u2[2]:
return True
else:
return False
from random import random
def monte_carlo(n):
nb_points_dans_sphère = 0
for point in range(n):
x = 2*random() - 1
y = 2*random() - 1
z = 2*random() - 1
if x**2 + y**2 + z**2 < =1:
nb_points_dans_sphère = nb_points_dans_sphère + 1
return nb_points_dans_sphère/n*8
def orthogonaux(u1, u2):
...
def repere(u1, u2, u3):
...