Fichier:Gauss function.svg
De testwiki
Aller à la navigation
Aller à la recherche
Fichier d’origine (Fichier SVG, nominalement de 1 000 × 1 000 pixels, taille : 670 kio)
Ce fichier provient de Wikimedia Commons et peut être utilisé par d'autres projets. Sa description sur sa page de description est affichée ci-dessous.
Description
| DescriptionGauss function.svg |
English: Gauss function f(x) = 1/x - floor(1/x) |
| Date | |
| Source | own work with help of Robert Dodier |
| Auteur ou autrice | Adam majewski |
Conditions d’utilisation
Moi, en tant que détenteur des droits d’auteur sur cette œuvre, je la publie sous la licence suivante :
Ce fichier est sous la licence Creative Commons Attribution – Partage dans les Mêmes Conditions 4.0 International.
- Vous êtes libre :
- de partager – de copier, distribuer et transmettre cette œuvre
- d’adapter – de modifier cette œuvre
- Sous les conditions suivantes :
- paternité – Vous devez donner les informations appropriées concernant l'auteur, fournir un lien vers la licence et indiquer si des modifications ont été faites. Vous pouvez faire cela par tout moyen raisonnable, mais en aucune façon suggérant que l’auteur vous soutient ou approuve l’utilisation que vous en faites.
- partage à l’identique – Si vous modifiez, transformez ou vous basez sur cet élément, vous devez distribuer votre contribution sous une license identique ou compatible à celle de l’original.
Maxima Cas src code
One can draw using simple command :
f(x):= 1/x - floor(1/x); plot2d(f(x),[x,0,1]);
For more precise drawing
- split curve into segments
- add end points
/*
https://stackoverflow.com/questions/49587741/how-to-draw-graph-of-gauss-function
Batch file for Maxima CAS
save as a g.mac
run maxima :
maxima
and then :
batch("g.mac");
*/
kill(all);
remvalue(all);
ratprint:false;
/* ---------- functions ---------------------------------------------------- */
/*
Gauss function
https://en.wikipedia.org/wiki/Gauss%E2%80%93Kuzmin%E2%80%93Wirsing_operator#The_Gaus_map
f: x -> y
*/
f(x):= 1/x - floor(1/x)$
/*
g : x -> x+y*i
*/
g(x):= x+f(x)*%i$
/*
converts complex number z = x*y*%i
to the list in a draw format:
[x,y]
*/
draw_f(z):=[float(realpart(z)), float(imagpart(z))]$
/* give Draw List from one point*/
dl(z):=points([draw_f(z)])$
ToPoints(myList):= points(map(draw_f , myList))$
/* gives part of graph */
GivePart(n):=(
[Part, xMax, xMin, dx, iMax],
if (n>20) then iMax:10
else iMax : 250,
xMax : 1/n,
xMin : 1/(n+1),
dx : (xMax - xMin)/iMax,
Part : makelist(xMin + i*dx, i, 0, iMax),
Part : map(g, Part),
Part[1] : xMin + %i, /* lower semi-continuous function */
Part
)$
GiveClosedPoint(z):=
[point_type = filled_circle,
points_joined = false,
point_size = 0.8,
dl(z)]$
GiveOpenPoint(z):=
[point_type = circle,
points_joined = false,
point_size = 0.9,
dl(z)]$
/*
*/
AddEndPoints(MyList):=(
[zLeft, zRight],
zLeft : first(MyList),
if (realpart(zLeft)>0.07) then MyList: delete(zLeft, MyList ),
zRight : last(MyList),
MyList :ToPoints(MyList),
MyList : [GiveOpenPoint(zLeft),point_type = filled_circle, points_joined =true, point_size = 0.1, MyList, points_joined = false, GiveClosedPoint(zRight)]
)$
GiveList(i_Max):=(
[Part, PartList ],
PartList:[],
for i:1 thru i_Max step 1 do (
Part: GivePart(i),
Part : AddEndPoints(Part),
PartList : cons(Part, PartList)
),
PartList
)$
compile(all);
nMax:60;
/* computations */
pp:GiveList(nMax)$
/* draw */
path:"~/maxima/batch/gauss/test/slim/"$ /* pwd, if empty then file is in a home dir , path should end with "/" */
/* draw it using draw package by */
load(draw);
/* if graphic file is empty (= 0 bytes) then run draw2d command again */
draw2d(
user_preamble="set key top right; unset mouse",
terminal = 'svg,
file_name = sconcat(path,"gauss", string(nMax), "a"),
font = "Liberation Sans", /* https://commons.wikimedia.org/wiki/Help:SVG#Font_substitution_and_fallback_fonts */
title= "Gauss function g(x)= 1/x - floor(1/x)",
/* */
dimensions = [1000, 1000],
yrange = [-0.1,1.1],
xrange = [-0.1,1.1],
xlabel = "x ",
ylabel = "y",
color = blue,
key = "",
pp /* draw accepts list of parameters and data */
)$
Légendes
Ajoutez en une ligne la description de ce que représente ce fichier
Éléments décrits dans ce fichier
dépeint
Valeur sans élément de Wikidata
2 avril 2018
686 143 octet
image/svg+xml
7812ddcc6278fda6e2e940da5961df2a7791f475
Historique du fichier
Cliquer sur une date et heure pour voir le fichier tel qu'il était à ce moment-là.
| Date et heure | Vignette | Dimensions | Utilisateur | Commentaire | |
|---|---|---|---|---|---|
| actuel | 5 avril 2018 à 17:40 | 1 000 × 1 000 (670 kio) | wikimediacommons>Soul windsurfer | smaller size due to : if (n>20) then iMax:10 else iMax : 250, |
Utilisation du fichier
Aucune page n’utilise ce fichier.