aboutsummaryrefslogtreecommitdiffstats
path: root/buch/chapters/110-elliptisch/images
diff options
context:
space:
mode:
authorAndreas Müller <andreas.mueller@ost.ch>2021-10-18 08:51:09 +0200
committerAndreas Müller <andreas.mueller@ost.ch>2021-10-18 08:51:09 +0200
commit24e0ebb5475b275af76900be4cbe5d7a8df0ef06 (patch)
tree0442a13a9c3b70e535f8c723e38b74f439029cc1 /buch/chapters/110-elliptisch/images
parentkomplementärmodul ergänzt (diff)
downloadSeminarSpezielleFunktionen-24e0ebb5475b275af76900be4cbe5d7a8df0ef06.tar.gz
SeminarSpezielleFunktionen-24e0ebb5475b275af76900be4cbe5d7a8df0ef06.zip
improve elliptic integrals
Diffstat (limited to '')
-rw-r--r--buch/chapters/110-elliptisch/images/rechteck.cpp53
-rw-r--r--buch/chapters/110-elliptisch/images/rechteck.pdfbin70950 -> 91630 bytes
2 files changed, 50 insertions, 3 deletions
diff --git a/buch/chapters/110-elliptisch/images/rechteck.cpp b/buch/chapters/110-elliptisch/images/rechteck.cpp
index 3ece11c..c3f6f1b 100644
--- a/buch/chapters/110-elliptisch/images/rechteck.cpp
+++ b/buch/chapters/110-elliptisch/images/rechteck.cpp
@@ -243,6 +243,7 @@ void curvedrawer::operator()(const curvetracer::curve_t& curve) {
static struct option longopts[] = {
{ "outfile", required_argument, NULL, 'o' },
{ "k", required_argument, NULL, 'k' },
+{ "deltax", required_argument, NULL, 'd' },
{ NULL, 0, NULL, 0 }
};
@@ -250,13 +251,18 @@ static struct option longopts[] = {
* \brief Main function
*/
int main(int argc, char *argv[]) {
- double k = 0.6;
+ double k = 0.625;
+ double deltax = 0.2;
int c;
int longindex;
std::string outfilename;
- while (EOF != (c = getopt_long(argc, argv, "o:k:", longopts, &longindex)))
+ while (EOF != (c = getopt_long(argc, argv, "o:k:d:", longopts,
+ &longindex)))
switch (c) {
+ case 'd':
+ deltax = std::stod(optarg);
+ break;
case 'o':
outfilename = std::string(optarg);
break;
@@ -296,7 +302,7 @@ int main(int argc, char *argv[]) {
// "circles"
std::complex<double> dir(0.01, 0);
- for (double im = 0.2; im < 3; im += 0.2) {
+ for (double im = deltax; im < 3; im += deltax) {
std::complex<double> startz(0, im);
std::complex<double> startw = ct.startpoint(startz);
curvetracer::curve_t curve = ct.trace(startz, dir,
@@ -345,7 +351,28 @@ int main(int argc, char *argv[]) {
(*cdp)(curvetracer::mirrory(curve));
}
+ // arguments between 1 and 1/k
+ {
+ for (double x0 = 1 + deltax; x0 < 1/k; x0 += deltax) {
+ double y0 = sqrt(1-1/(x0*x0))/kprime;
+ //std::cout << "y0 = " << y0 << std::endl;
+ double y = gsl_sf_ellint_F(asin(y0), kprime,
+ GSL_PREC_DOUBLE);
+ std::complex<double> startz(x0);
+ std::complex<double> startw(xmax, y);
+ curvetracer::curve_t curve = ct.trace(startz, dir,
+ startw, 1000);
+ cdp->color("red");
+ (*cdp)(curve);
+ (*cdp)(curvetracer::mirrorx(curve));
+ cdp->color("blue");
+ (*cdp)(curvetracer::mirror(curve));
+ (*cdp)(curvetracer::mirrory(curve));
+ }
+ }
+
// argument 1/k
+#if 0
{
std::complex<double> startz(1/k);
std::complex<double> startw(xmax, ymax);
@@ -358,6 +385,26 @@ int main(int argc, char *argv[]) {
(*cdp)(curvetracer::mirror(curve));
(*cdp)(curvetracer::mirrory(curve));
}
+#endif
+
+ // arguments larger than 1/k
+ {
+ double x0 = 1;
+ while (x0 <= 1/k + 0.0001) { x0 += deltax; }
+ for (; x0 < 4; x0 += deltax) {
+ std::complex<double> startz(x0);
+ std::complex<double> startw(gsl_sf_ellint_F(
+ asin(1/(k*x0)), k, GSL_PREC_DOUBLE), ymax);
+ curvetracer::curve_t curve = ct.trace(startz, dir,
+ startw, 1000);
+ cdp->color("red");
+ (*cdp)(curve);
+ (*cdp)(curvetracer::mirrorx(curve));
+ cdp->color("blue");
+ (*cdp)(curvetracer::mirror(curve));
+ (*cdp)(curvetracer::mirrory(curve));
+ }
+ }
// border
(*cdp->out()) << "\\def\\xmax{" << xmax << "}" << std::endl;
diff --git a/buch/chapters/110-elliptisch/images/rechteck.pdf b/buch/chapters/110-elliptisch/images/rechteck.pdf
index 5fa07cb..845a550 100644
--- a/buch/chapters/110-elliptisch/images/rechteck.pdf
+++ b/buch/chapters/110-elliptisch/images/rechteck.pdf
Binary files differ