Newer
Older
import math
ux = float(input("ux = "))
uy = float(input("uy = "))
uz = float(input("uz = "))
vx = float(input("vx = "))
vy = float(input("vy = "))
vz = float(input("vz = "))
produit_scalaire_uv = ux*vx + uy*vy + uz*vz
print("u.v = {0}".format(produit_scalaire_uv))
norme_u = math.sqrt(ux*ux + uy*uy + uz*uz)
print("|u| = {0}".format(norme_u))
norme_v = math.sqrt(vx*vx + vy*vy + vz*vz)
print("|v| = {0}".format(norme_v))
wx = uy*vz - uz*vy
wy = uz*vx - ux*vz
wz = ux*vy - uy*vx
print("w = u x v = ({0},{1},{2})".format(wx,wy,wz))
produit_scalaire_wv = wx*vx + wy*vy + wz*vz
produit_scalaire_wu = wx*ux + wy*uy + wz*uz
print("Verification : w.v = {0} et w.u = {1}".format(produit_scalaire_wv,produit_scalaire_wu))