aboutsummaryrefslogtreecommitdiffstats
path: root/buch/chapters/80-wahrscheinlichkeit/images/dreieck.m
diff options
context:
space:
mode:
authorAndreas Müller <andreas.mueller@ost.ch>2021-01-26 13:11:37 +0100
committerAndreas Müller <andreas.mueller@ost.ch>2021-01-26 13:11:37 +0100
commita503cc5c7fcbb125ec7c220845b9e760248db233 (patch)
tree1eea3a0beeb25babc0725182e208a3dff64b36ac /buch/chapters/80-wahrscheinlichkeit/images/dreieck.m
parentPerron-Frobenius Theorie (diff)
downloadSeminarMatrizen-a503cc5c7fcbb125ec7c220845b9e760248db233.tar.gz
SeminarMatrizen-a503cc5c7fcbb125ec7c220845b9e760248db233.zip
Visualisierungen für Perron-Frobenius-Theorie
Diffstat (limited to '')
-rw-r--r--buch/chapters/80-wahrscheinlichkeit/images/dreieck.m41
1 files changed, 41 insertions, 0 deletions
diff --git a/buch/chapters/80-wahrscheinlichkeit/images/dreieck.m b/buch/chapters/80-wahrscheinlichkeit/images/dreieck.m
new file mode 100644
index 0000000..cc9661b
--- /dev/null
+++ b/buch/chapters/80-wahrscheinlichkeit/images/dreieck.m
@@ -0,0 +1,41 @@
+#
+# dreieck.m
+#
+# (c) 2021 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule
+#
+w = 12
+N = 10
+
+rand("seed", 1);
+
+angles = 80 * rand(1,N)
+radii = 2 * rand(1,N) + 0.4
+angle = 20
+
+radii = radii * w / (cosd(angle) * sum(radii))
+radius = sum(radii)
+radius * cosd(angle)
+
+points = zeros(2,N);
+ray = zeros(2,N);
+
+p = [ 0; 0 ];
+for i = (1:N)
+ p = p + radii(1,i) * [ cosd(angles(1,i)); sind(angles(1,i)) ];
+ points(:, i) = p;
+ ray(:, i) = sum(radii(1,1:i)) * [ cosd(angle); sind(angle) ];
+end
+
+points
+
+ray
+
+fn = fopen("drei.inc", "w");
+for i = (1:N)
+ fprintf(fn, "\\coordinate (A%d) at (%.4f,%.4f);\n", i,
+ points(1,i), points(2,i));
+ fprintf(fn, "\\coordinate (B%d) at (%.4f,%.4f);\n", i,
+ ray(1,i), ray(2,i));
+end
+fprintf(fn, "\\def\\r{%.4f}\n", radius);
+fclose(fn);