File:Funktionsgraph z(Q) (0-9).svg

Summary

Description
Deutsch: Funktionsgraph (im kartesischen Koordinatensystem) für für im Intervall [0..9]
English: Graph of the function (in Cartesian coordinate system) for in interval [0..9]
Date
Source Own work
Author SweetWood
Other versions Funktionsgraph Q(z) (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 Q_start = 0;  // start value for drawing graph of inverse function z(Q)
int Q_end   = 9;  // end value for drawing graph of inverse function z(Q)

// prove if the given number is even
// Parameters: n ... integer number
// Returns: true if n is even; false otherwise
//
bool isEven(int n) {
  return ((n % 2) == 0);
}

// prove if the given number is odd
// Parameters: n ... integer number
// Returns: true if n is odd; false otherwise
//
bool isOdd(int n) {
  return ((n % 2) != 0);
}

// calculate inverse function of Q
// Parameters: n ... integer number
// Returns: n/2 if n is even;
//          (n+9)/2 otherwise
//
int Qinverse(int n=0) {
  if (isEven(n)) { return (n # 2); }
  return ((n + 9) # 2);
}

// draw graph of inverse function z(Q)
pen graphPen = red + scale(2) * currentpen;
for (int Q = Q_start; Q < (Q_end + 1); ++Q) {
  dot( (Q, Qinverse(Q)), graphPen );
}

// axes
pen axesPen = gray(0.5) + dashed + linewidth(0.5*linewidth());
xaxis( "$Q$",
       BottomTop,
       LeftTicks(n=1, begin=false, end=false, extend=true, pTick=axesPen) );
yaxis( "$z(Q)$",
       LeftRight,
       RightTicks(n=1, begin=false, end=false, extend=true, pTick=axesPen) );

// label
real pos = (Q_end - Q_start) / 2.0;
label(scale(2) * "$z(Q)$", (pos, pos), graphPen);

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
Creative Commons CC-Zero 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.

Category:CC-Zero#Funktionsgraph%20z(Q)%20(0-9).svgCategory:Self-published work
Category:Function plots
Category:CC-Zero Category:Function plots Category:Self-published work Category:Valid SVG created with Asymptote code