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

Function projection

linear_algebra/src/transformations_2d.py:39–47  ·  view source on GitHub ↗

>>> projection(45) # doctest: +NORMALIZE_WHITESPACE [[0.27596319193541496, 0.446998331800279], [0.446998331800279, 0.7240368080645851]]

(angle: float)

Source from the content-addressed store, hash-verified

37
38
39def projection(angle: float) -> list[list[float]]:
40 """
41 >>> projection(45) # doctest: +NORMALIZE_WHITESPACE
42 [[0.27596319193541496, 0.446998331800279],
43 [0.446998331800279, 0.7240368080645851]]
44 """
45 c, s = cos(angle), sin(angle)
46 cs = c * s
47 return [[c * c, cs], [cs, s * s]]
48
49
50def reflection(angle: float) -> list[list[float]]:

Callers 1

Calls 1

sinFunction · 0.90

Tested by

no test coverage detected