From eceae67b3a13bc28acc446288429a90be2efa99d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=BCller?= Date: Sat, 21 May 2022 12:45:42 +0200 Subject: curvature graph --- buch/papers/kugel/images/curvature.pov | 72 ++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 buch/papers/kugel/images/curvature.pov (limited to 'buch/papers/kugel/images/curvature.pov') diff --git a/buch/papers/kugel/images/curvature.pov b/buch/papers/kugel/images/curvature.pov new file mode 100644 index 0000000..3535488 --- /dev/null +++ b/buch/papers/kugel/images/curvature.pov @@ -0,0 +1,72 @@ +// +// curvature.pov +// +// (c) 2022 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule +// + +#version 3.7; +#include "colors.inc" + +global_settings { + assumed_gamma 1 +} + +#declare imagescale = 0.1; + +camera { + location <40, 10, -20> + look_at <0, 0, 0> + right 16/9 * x * imagescale + up y * imagescale +} + +light_source { + <10, 10, -40> color White + area_light <1,0,0> <0,0,1>, 10, 10 + adaptive 1 + jitter +} + +sky_sphere { + pigment { + color rgb<1,1,1> + } +} + +// +// draw an arrow from to with thickness with +// color +// +#macro arrow(from, to, arrowthickness, c) +#declare arrowdirection = vnormalize(to - from); +#declare arrowlength = vlength(to - from); +union { + sphere { + from, 1.1 * arrowthickness + } + cylinder { + from, + from + (arrowlength - 5 * arrowthickness) * arrowdirection, + arrowthickness + } + cone { + from + (arrowlength - 5 * arrowthickness) * arrowdirection, + 2 * arrowthickness, + to, + 0 + } + pigment { + color c + } + finish { + specular 0.9 + metallic + } +} +#end + +arrow(<-3.1,0,0>, <3.1,0,0>, 0.01, White) +arrow(<0,-1,0>, <0,1,0>, 0.01, White) +arrow(<0,0,-2.1>, <0,0,2.1>, 0.01, White) + +#include "curvature.inc" -- cgit v1.2.1 From ab62c3937cc111ce1d61d76f0bdf396a4a5a9297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=BCller?= Date: Sat, 21 May 2022 20:36:01 +0200 Subject: add image code --- buch/papers/kugel/images/curvature.pov | 72 ++++++++++++++++++++++++++++++++-- 1 file changed, 69 insertions(+), 3 deletions(-) (limited to 'buch/papers/kugel/images/curvature.pov') diff --git a/buch/papers/kugel/images/curvature.pov b/buch/papers/kugel/images/curvature.pov index 3535488..9dbaa86 100644 --- a/buch/papers/kugel/images/curvature.pov +++ b/buch/papers/kugel/images/curvature.pov @@ -11,17 +11,17 @@ global_settings { assumed_gamma 1 } -#declare imagescale = 0.1; +#declare imagescale = 0.09; camera { - location <40, 10, -20> + location <10, 10, -40> look_at <0, 0, 0> right 16/9 * x * imagescale up y * imagescale } light_source { - <10, 10, -40> color White + <-10, 10, -40> color White area_light <1,0,0> <0,0,1>, 10, 10 adaptive 1 jitter @@ -70,3 +70,69 @@ arrow(<0,-1,0>, <0,1,0>, 0.01, White) arrow(<0,0,-2.1>, <0,0,2.1>, 0.01, White) #include "curvature.inc" + +#declare sigma = 1; +#declare N0 = 0.5; +#declare funktion = function(r) { + (exp(-r*r/(sigma*sigma)) / sigma + - + exp(-r*r/(2*sigma*sigma)) / (sqrt(2)*sigma)) / N0 +}; +#declare hypot = function(xx, yy) { sqrt(xx*xx+yy*yy) }; + +#declare Funktion = function(x,y) { funktion(hypot(x+1,y)) - funktion(hypot(x-1,y)) }; +#macro punkt(xx,yy) + +#end + +#declare griddiameter = 0.006; +union { + #declare xmin = -3; + #declare xmax = 3; + #declare ymin = -2; + #declare ymax = 2; + + + #declare xstep = 0.2; + #declare ystep = 0.02; + #declare xx = xmin; + #while (xx < xmax + xstep/2) + #declare yy = ymin; + #declare P = punkt(xx, yy); + #while (yy < ymax - ystep/2) + #declare yy = yy + ystep; + #declare Q = punkt(xx, yy); + sphere { P, griddiameter } + cylinder { P, Q, griddiameter } + #declare P = Q; + #end + sphere { P, griddiameter } + #declare xx = xx + xstep; + #end + + #declare xstep = 0.02; + #declare ystep = 0.2; + #declare yy = ymin; + #while (yy < ymax + ystep/2) + #declare xx = xmin; + #declare P = punkt(xx, yy); + #while (xx < xmax - xstep/2) + #declare xx = xx + xstep; + #declare Q = punkt(xx, yy); + sphere { P, griddiameter } + cylinder { P, Q, griddiameter } + #declare P = Q; + #end + sphere { P, griddiameter } + #declare yy = yy + ystep; + #end + + pigment { + color rgb<0.8,0.8,0.8> + } + finish { + metallic + specular 0.8 + } +} + -- cgit v1.2.1 From d8d6a61a2ab45d9171a93e4a72d254a3ed5ef87f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=BCller?= Date: Sat, 21 May 2022 20:42:47 +0200 Subject: fix some bugs --- buch/papers/kugel/images/curvature.pov | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'buch/papers/kugel/images/curvature.pov') diff --git a/buch/papers/kugel/images/curvature.pov b/buch/papers/kugel/images/curvature.pov index 9dbaa86..3b15d77 100644 --- a/buch/papers/kugel/images/curvature.pov +++ b/buch/papers/kugel/images/curvature.pov @@ -72,7 +72,8 @@ arrow(<0,0,-2.1>, <0,0,2.1>, 0.01, White) #include "curvature.inc" #declare sigma = 1; -#declare N0 = 0.5; +#declare s = 1.4; +#declare N0 = 0.4; #declare funktion = function(r) { (exp(-r*r/(sigma*sigma)) / sigma - @@ -80,7 +81,7 @@ arrow(<0,0,-2.1>, <0,0,2.1>, 0.01, White) }; #declare hypot = function(xx, yy) { sqrt(xx*xx+yy*yy) }; -#declare Funktion = function(x,y) { funktion(hypot(x+1,y)) - funktion(hypot(x-1,y)) }; +#declare Funktion = function(x,y) { funktion(hypot(x+s,y)) - funktion(hypot(x-s,y)) }; #macro punkt(xx,yy) #end -- cgit v1.2.1