10 examples of 'python radians to degrees' in Python

Every line of 'python radians to degrees' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
71def degree_from_radians(angles):
72 if (type(angles) in (tuple, list)):
73 return [a / math.pi * 180 for a in angles]
74 return angles / math.pi * 180
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

119def angle_from_rotation(r):
120 return ((r.trace() - 1) / 2).acos()
106def _sinDeg(angle):
107 return math.sin(math.radians(angle))
123def radians(self):
124 return math.radians(self.D)
108def rotate(x, y, angle):
109 """rotation transformation for a point."""
110 cost = cos(angle) #cost is short for cos(theta)
111 sint = sin(angle)
112 newx = x * cost - y * sint
113 newy = x * sint + y * cost
114 return (newx, newy)
22def bearing_to_cardinal(angle):
23 """Get cardinality of an angle.
24
25 :param angle: Bearing angle.
26 :type angle: float
27
28 :return: cardinality of input angle.
29 :rtype: string
30 """
31
32 # this method could still be improved later, since the acquisition interval
33 # is a bit strange, i.e the input angle of 22.499° will return `N` even
34 # though 22.5° is the direction for `NNE`
35 direction_list = [
36 'N', 'NNE', 'NE', 'ENE', 'E', 'ESE', 'SE',
37 'SSE', 'S', 'SSW', 'SW', 'WSW', 'W',
38 'WNW', 'NW', 'NNW'
39 ]
40
41 bearing = float(angle)
42 direction_count = len(direction_list)
43 direction_interval = 360. / direction_count
44 index = int(math.floor(bearing / direction_interval))
45 index %= direction_count
46 return direction_list[index]
426def _resolveangle(angle):
427 if not angle:
428 return 0
429 angle %= 360
430 return int(round(angle / ANGLE_RESOLUTION_DEGREES)) * ANGLE_RESOLUTION_DEGREES
22def longitudinal_degrees_from_meters_at_latitude(meters, latitude):
23 one_longitudinal_degree_in_meters = width_of_longitudinal_degree_in_meters_for_latitude(latitude)
24 return meters / one_longitudinal_degree_in_meters
794def radians(x):
795 if isinstance(x, Reward):
796 y = copy.copy(x) # shallow copy
797 y._compute = lambda: np.radians(x())
798 y.range = (np.radians(x.range[0]), np.radians(x.range[1]))
799 return y
800 else:
801 return np.radians(x)
16def sin(angle):
17 '''Sine of an angle (in degrees)'''
18 return _math.sin(angle * _dg)

Related snippets