Compare commits
No commits in common. "888049460ecfe0e6b6436801a429c85aaf22b609" and "300706bc9d23b92c34a68a7aa164aeea9f6bdc4e" have entirely different histories.
888049460e
...
300706bc9d
8
.idea/.gitignore
generated
vendored
8
.idea/.gitignore
generated
vendored
@ -1,8 +0,0 @@
|
|||||||
# Default ignored files
|
|
||||||
/shelf/
|
|
||||||
/workspace.xml
|
|
||||||
# Editor-based HTTP Client requests
|
|
||||||
/httpRequests/
|
|
||||||
# Datasource local storage ignored files
|
|
||||||
/dataSources/
|
|
||||||
/dataSources.local.xml
|
|
||||||
10
.idea/MatrixMania.iml
generated
10
.idea/MatrixMania.iml
generated
@ -1,10 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="PYTHON_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager">
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/.venv" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="jdk" jdkName="Python 3.12 (MatrixMania)" jdkType="Python SDK" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
||||||
6
.idea/inspectionProfiles/Project_Default.xml
generated
6
.idea/inspectionProfiles/Project_Default.xml
generated
@ -1,6 +0,0 @@
|
|||||||
<component name="InspectionProjectProfileManager">
|
|
||||||
<profile version="1.0">
|
|
||||||
<option name="myName" value="Project Default" />
|
|
||||||
<inspection_tool class="LanguageDetectionInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
||||||
</profile>
|
|
||||||
</component>
|
|
||||||
6
.idea/inspectionProfiles/profiles_settings.xml
generated
6
.idea/inspectionProfiles/profiles_settings.xml
generated
@ -1,6 +0,0 @@
|
|||||||
<component name="InspectionProjectProfileManager">
|
|
||||||
<settings>
|
|
||||||
<option name="USE_PROJECT_PROFILE" value="false" />
|
|
||||||
<version value="1.0" />
|
|
||||||
</settings>
|
|
||||||
</component>
|
|
||||||
6
.idea/misc.xml
generated
6
.idea/misc.xml
generated
@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="Black">
|
|
||||||
<option name="sdkName" value="Python 3.12 (MatrixMania)" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
8
.idea/modules.xml
generated
8
.idea/modules.xml
generated
@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectModuleManager">
|
|
||||||
<modules>
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/MatrixMania.iml" filepath="$PROJECT_DIR$/.idea/MatrixMania.iml" />
|
|
||||||
</modules>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
6
.idea/vcs.xml
generated
6
.idea/vcs.xml
generated
@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="VcsDirectoryMappings">
|
|
||||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
80
compute..py
80
compute..py
@ -1,80 +0,0 @@
|
|||||||
from typing import List
|
|
||||||
import math
|
|
||||||
from tabulate import tabulate
|
|
||||||
|
|
||||||
def matmul(matrix_a: List[List[int]], matrix_b: List[List[int]]) -> List[List[int]]:
|
|
||||||
"""
|
|
||||||
Matrix multiplication
|
|
||||||
:param matrix_a: Matrix A
|
|
||||||
:param matrix_b: Matrix B
|
|
||||||
:return: product of matrix_a and matrix_b
|
|
||||||
:raises: ValueError: wenn Matrix A and Matrix B nicht multipliezierbar sind
|
|
||||||
"""
|
|
||||||
|
|
||||||
if len(matrix_a[0]) != len(matrix_b):
|
|
||||||
print(len(matrix_a[0]))
|
|
||||||
print(len(matrix_b))
|
|
||||||
raise ValueError("Matrix kann nicht multipliziert werden")
|
|
||||||
|
|
||||||
ergebnis1 = []
|
|
||||||
ergebnis2 = []
|
|
||||||
result = 0
|
|
||||||
spalte_max = len(matrix_b[0])
|
|
||||||
zeile = 0
|
|
||||||
|
|
||||||
for spalte in range(len(matrix_a)):
|
|
||||||
for zeile in range(spalte_max):
|
|
||||||
for z in range(len(matrix_a[0])):
|
|
||||||
zahl = matrix_a[spalte][z] * matrix_b[z][zeile]
|
|
||||||
result = result + zahl
|
|
||||||
ergebnis1.append(result)
|
|
||||||
result = 0
|
|
||||||
ergebnis2.append(ergebnis1)
|
|
||||||
ergebnis1 = []
|
|
||||||
|
|
||||||
return ergebnis2
|
|
||||||
|
|
||||||
def transpose(matrix: list[list[int]]) -> list[list[int]]:
|
|
||||||
"""
|
|
||||||
Transpose a matrix
|
|
||||||
:param matrix: valid matrix
|
|
||||||
:return: transpose of matrix
|
|
||||||
"""
|
|
||||||
if len(matrix) == 0:
|
|
||||||
raise ValueError("Matrix leer")
|
|
||||||
mindest_länge = len(matrix[0])
|
|
||||||
for zeile in range(len(matrix)):
|
|
||||||
if len(matrix[zeile]) != mindest_länge :
|
|
||||||
raise ValueError("Matrix falsch")
|
|
||||||
|
|
||||||
anzahl_spalten= len(matrix)
|
|
||||||
anzahl_zeilen= len(matrix[0])
|
|
||||||
ergebnis1 = []
|
|
||||||
ergebnis2 = []
|
|
||||||
for z in range(anzahl_zeilen):
|
|
||||||
for s in range(anzahl_spalten):
|
|
||||||
ergebnis1.append(matrix[s][z])
|
|
||||||
|
|
||||||
ergebnis2.append(ergebnis1)
|
|
||||||
ergebnis1 = []
|
|
||||||
|
|
||||||
return ergebnis2
|
|
||||||
|
|
||||||
|
|
||||||
def rot_2D(angle: int) -> List[List[int]]:
|
|
||||||
"""
|
|
||||||
Rotation matrix
|
|
||||||
:param angle: any angle
|
|
||||||
:return: rotation matrix
|
|
||||||
"""
|
|
||||||
zahl1 = math.cos(math.radians(angle))
|
|
||||||
zahl2 = -math.sin(math.radians(angle))
|
|
||||||
zahl3 = math.sin(math.radians(angle))
|
|
||||||
zahl4 = math.cos(math.radians(angle))
|
|
||||||
|
|
||||||
return [[zahl1, zahl2], [zahl3, zahl4]]
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
#made by chatGBT
|
|
||||||
print(rot_2D())
|
|
||||||
Loading…
x
Reference in New Issue
Block a user