MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / rotation

Function rotation

linear_algebra/src/transformations_2d.py:29–36  ·  view source on GitHub ↗

>>> rotation(45) # doctest: +NORMALIZE_WHITESPACE [[0.5253219888177297, -0.8509035245341184], [0.8509035245341184, 0.5253219888177297]]

(angle: float)

Source from the content-addressed store, hash-verified

27
28
29def rotation(angle: float) -> list[list[float]]:
30 """
31 >>> rotation(45) # doctest: +NORMALIZE_WHITESPACE
32 [[0.5253219888177297, -0.8509035245341184],
33 [0.8509035245341184, 0.5253219888177297]]
34 """
35 c, s = cos(angle), sin(angle)
36 return [[c, -s], [s, c]]
37
38
39def projection(angle: float) -> list[list[float]]:

Callers 1

Calls 1

sinFunction · 0.90

Tested by

no test coverage detected