Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
JupyterMathe1
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christian Höfert
JupyterMathe1
Merge requests
!1
Revert "Delete M1_LineareAbbildungen.ipynb"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Revert "Delete M1_LineareAbbildungen.ipynb"
revert-4d033bed
into
main
Overview
0
Commits
1
Pipelines
0
Changes
1
Closed
Christian Höfert
requested to merge
revert-4d033bed
into
main
3 years ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
This reverts commit
4d033bed
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
cf6201c9
1 commit,
3 years ago
1 file
+
117
−
0
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
M1_LineareAbbildungen.ipynb
0 → 100644
+
117
−
0
Options
%% Cell type:markdown id: tags:
Importieren der nötigen Bibliotheken
%% Cell type:code id: tags:
```
python
import
numpy
as
np
import
math
import
matplotlib.pyplot
as
plt
%% Cell type:markdown id: tags:
**Definition der Punktemenge**
(Eckpunkte der folgenden Figur):
*
Die Punkte werden zunächst als Zeilen einer $n
\t
imes 2$-Matrix $P$ definiert.
*
Danach werden diese Matrix zu einer $2
\t
imes n$- Matrix transponiert $P
\r
ightarrow P^T$.
%% Cell type:code id: tags:
```
python
#points =[[0,2],[0,-2],[3,0],[3,2],[4,3],[5,2],[-1,3]]
points
=
[[
0
,
2
],[
1
,
-
2
],[
3
,
0
]]
points
=
np
.
transpose
(
points
)
# Plotten als Punkte
plt
.
plot
(
points
[
0
],
points
[
1
],
'
bo
'
)
# Plotten des Polygons
plt
.
fill
(
points
[
0
],
points
[
1
],
facecolor
=
(
0
,.
2
,
1
,.
7
))
# Einrichten des Plots
plt
.
axis
(
'
equal
'
)
# gleiche Skalierung x,y
plt
.
grid
(
'
both
'
)
# Gitterlinien
%% Output
%% Cell type:markdown id: tags:
**Definition der finalen Abbildungsmatrix**
$A$
%% Cell type:code id: tags:
```
python
S
=
[[
-
1
,
0
],[
0
,
1
]]
# Spiegelung
M
=
[[
4
,
0
],[
0
,.
5
]]
# Skalierung
R
=
math
.
sqrt
(
2
)
/
2
*
np
.
array
([[
1
,
1
],[
-
1
,
1
]])
# Drehung
A
=
S
#A=np.matmul(M,S)
%% Cell type:markdown id: tags:
**Anwenden der Abbilungsmatrix**
, d.h. für jeden Ortsvektor $
\v
ec v$ wird $$
\v
ec v
\m
apsto A
\c
dot
\v
ec v$$ ausgeführt.
%% Cell type:code id: tags:
```
python
# transformierten Punkte
pointsTransformed
=
np
.
matmul
(
A
,
points
)
plt
.
plot
(
pointsTransformed
[
0
],
pointsTransformed
[
1
],
'
yo
'
)
plt
.
fill
(
pointsTransformed
[
0
],
pointsTransformed
[
1
],
facecolor
=
(
1
,.
7
,
0
,.
7
))
# zum Verleich nochmal die ursprünglichen Punkte
plt
.
plot
(
points
[
0
],
points
[
1
],
'
bo
'
)
# Plotten des Polygons
plt
.
fill
(
points
[
0
],
points
[
1
],
facecolor
=
(
0
,.
2
,
1
,.
7
))
# Einrichten des Plots
plt
.
axis
(
'
equal
'
)
# gleiche Skalierung x,y
plt
.
grid
(
'
both
'
)
# Gitterlinien
%% Output
%% Cell type:markdown id: tags:
Durch Hinzufügen einer Translation $
\v
ec t$ wird die lineare Abbildung zu einer
**affinen Abbildung**
$$
\v
ec v
\m
apsto A
\c
dot
\v
ec v +
\v
ec t
$$
%% Cell type:code id: tags:
```
python
t
=
np
.
transpose
([[
5
,
2
]])
pointsAffine
=
pointsTransformed
+
t
#elementweise Addition des Vektors t
plt
.
fill
(
pointsAffine
[
0
],
pointsAffine
[
1
],
facecolor
=
(
1
,
0
,.
5
,.
5
))
### die alten Figuren
pointsTransformed
=
np
.
matmul
(
A
,
points
)
plt
.
plot
(
pointsTransformed
[
0
],
pointsTransformed
[
1
],
'
yo
'
)
plt
.
fill
(
pointsTransformed
[
0
],
pointsTransformed
[
1
],
facecolor
=
(
1
,.
7
,
0
,.
7
))
# zum Verleich nochmal die ursprünglichen Punkte
plt
.
plot
(
points
[
0
],
points
[
1
],
'
bo
'
)
# Plotten des Polygons
plt
.
fill
(
points
[
0
],
points
[
1
],
facecolor
=
(
0
,.
2
,
1
,.
7
))
# Einrichten des Plots
plt
.
axis
(
'
equal
'
)
# gleiche Skalierung x,y
plt
.
grid
(
'
both
'
)
# Gitterlinien
%% Output
%% Cell type:code id: tags:
```
python
Loading