Merge pull request #269 from helplessThor/helplessThor-degree-rad

Angle Conversion Between Degree and Radians
This commit is contained in:
Luke Weiler
2020-10-19 21:32:37 -04:00
committed by GitHub
3 changed files with 34 additions and 0 deletions

View File

@@ -88,3 +88,5 @@ from .arithmeticProgressionTermFunc import *
from .arithmeticProgressionSumFunc import * from .arithmeticProgressionSumFunc import *
from .decimalToOctalFunc import * from .decimalToOctalFunc import *
from .decimalToRomanNumeralsFunc import * from .decimalToRomanNumeralsFunc import *
from .degreeToRadFunc import *
from .radianToDegFunc import *

View File

@@ -0,0 +1,16 @@
from .__init__ import *
from numpy import pi
def degreeToRadFunc(max_deg=360):
a = random.randint(0, max_deg)
b = (pi * a) / 180
b = round(b, 2)
problem = "Angle " + str(a) + " in radians is = "
solution = str(b)
return problem, solution
degreeToRad = Generator("Degrees to Radians", 86, "Angle a in radians is = ", "b", degreeToRadFunc)

View File

@@ -0,0 +1,16 @@
from .__init__ import *
from numpy import pi
def degreeToRadFunc(max_rad=pi):
a = random.randint(0, max_rad)
b = (180 * a) / pi
b = round(b, 2)
problem = "Angle " + str(a) + " in degrees is = "
solution = str(b)
return problem, solution
radianToDeg = Generator("Radians to Degrees", 87, "Angle a in degrees is = ", "b", radianToDegFunc)