mespri.py

Created by pascal-chauvin

Created on June 06, 2018

230 Bytes

Le programme propose la fonction mp(x) qui calcule la mesure principale d’un angle orienté de mesure x radians.


# mesure principale d'un angle en radians

from math import *

def mp(x):
  if x>=0:
    while x>pi:
      x -= 2*pi
  else:
    while x<=-pi:
      x += 2*pi
  return x

print(mp(-5.2))
print(mp(3))
print(mp(2*pi))

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 cookies policy.