File:Funktionsgraph Q(z) (0-9).svg
Original file (SVG file, nominally 239 × 238 pixels, file size: 39 KB)
Captions
Summary[edit]
DescriptionFunktionsgraph Q(z) (0-9).svg |
Deutsch: Funktionsgraph (im kartesischen Koordinatensystem) für für im Intervall [0..9]; wobei die Quersumme der Zahl bedeutet
English: Graph of the function (in Cartesian coordinate system) for in interval [0..9]; with digit sum of number |
Date | |
Source | Own work |
Author | SweetWood |
Other versions | Funktionsgraph z(Q) (0-9).svg |
SVG development InfoField | |
Source code InfoField | Asymptote code// created with Asymptote 2.47
import graph;
import settings;
outformat="pdf";
unitsize(6.2mm);
int z_start = 0; // start value for drawing graph of function Q(z)
int z_end = 9; // end value for drawing graph of function Q(z)
// calculate the digit sum of the given number
// Parameters: n ... integer number
// Returns: digit sum of n;
// 0 if n equals 0; negative if n < 0; positive if n > 0;
// => digitSum(-n) = -digitSum(n)
//
int digitSum(int n=0) {
int sign = sgn(n);
n = abs(n);
string n_str = (string)n;
string[] n_arr = array(n_str);
int sum = 0;
for (int i = 0; i < n_arr.length; ++i) {
sum += (int)(n_arr[i]);
}
return (sign * sum);
}
// calculate the digit sum of the doubled given number
// Parameters: n ... integer number
// Returns: digit sum of 2*n;
// 0 if n equals 0; negative if n < 0; positive if n > 0;
// => Q(-n) = -Q(n)
//
int Q(int n=0) {
return digitSum(2*n);
}
// draw graph of function Q(z)
pen graphPen = red + scale(2) * currentpen;
for (int z = z_start; z < (z_end + 1); ++z) {
dot( (z, Q(z)), graphPen );
}
// axes
pen axesPen = gray(0.5) + dashed + linewidth(0.5*linewidth());
xaxis( "$z$",
BottomTop,
LeftTicks(n=1, begin=false, end=false, extend=true, pTick=axesPen) );
yaxis( "$Q(z) = q(2 \cdot z)$",
LeftRight,
RightTicks(n=1, begin=false, end=false, extend=true, pTick=axesPen) );
// label
real pos = (z_end - z_start) / 2.0;
label(scale(2) * "$Q(z)$", (pos, pos), graphPen);
|
Licensing[edit]
This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication. | |
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.
http://creativecommons.org/publicdomain/zero/1.0/deed.enCC0Creative Commons Zero, Public Domain Dedicationfalsefalse |
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 15:43, 29 October 2018 | 239 × 238 (39 KB) | SweetWood (talk | contribs) | changed proportions for easier readability | |
15:30, 28 October 2018 | 361 × 359 (40 KB) | SweetWood (talk | contribs) | improved graphics | ||
15:39, 16 December 2016 | 461 × 461 (34 KB) | SweetWood (talk | contribs) | auf quadratisches Bildformat umgestellt | ||
15:27, 12 December 2016 | 744 × 1,052 (34 KB) | SweetWood (talk | contribs) | User created page with UploadWizard |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.
File usage on other wikis
The following other wikis use this file:
- Usage on de.wikipedia.org
Metadata
This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.
Width | 191.46pt |
---|---|
Height | 190.09pt |