vecteurs.py

Created by numworks

Created on April 11, 2018

153 Bytes

Le script contient deux fonctions concernant le calcul sur les vecteurs. La fonction coordinates(x_A,y_A,x_B,y_B) renvoie les coordonnées du vecteur AB avec A(x_A,y_A) et B(x_B,y_B). La fonction collinear(x_1,y_1,x_2,y_2) renvoie True si les vecteurs u(x_1,y_1) et v(x_2,y_2) sont colinéaires et False sinon.


from math import *
def coordinates(x_A,y_A,x_B,y_B):
  return x_B-x_A,y_B-y_A
def collinear(x_1,y_1,x_2,y_2):
  return x_1*y_2-x_2*y_1==0

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our <a href="https://www.numworks.com/legal/cookies-policy/">cookies policy</a>.