File:Rational Representation.svg
Original file (SVG file, nominally 629 × 629 pixels, file size: 132 KB)
Captions
Summary[edit]
DescriptionRational Representation.svg |
English: Representation of rational numbers (Q) as pairs of integers, equivalent pairs on the same line.
Français : Représentation des nombres rationnels comme des paires de nombres entiers, les paires équivalentes sur le même ligne. |
Date | |
Source | Own work |
Author | TomT0m |
Other versions | File:RationalRepresentation.pdf |
Source of the file, in the en:asymptote graphic programming language: fr:Utilisateur:TomT0m/RationalRepresentation.asy
import settings;
import graph;
import math;
pdfviewer="/usr/bin/evince";
psviewer="evince";
// parameters
int num=10;
int gcd(int a,int b){
if(b==0){
return a;
}else{
return gcd(b,a-quotient(a,b)*b);
}
}
bool isPrimeWith(int a,int b){
return gcd(a,b)==1;
}
pen color_rational(int x,int y){
if(y==0){
return white;
}else{
real ratio = x
/y;
return rgb(0.5*(1+ratio),0.7*(1+ratio),0.3*(1-ratio));
}
}
unitsize(2,2);
picture damier;
// unitsize(damier,1,1);
size(damier,5000,5000,(-100,-100),(100,100));
dot(damier,(0,0));
dot(damier,(-num,-num),invisible);
dot(damier,(num,num),invisible);
for(int x=-num; x<=num;++x){
for(int y=-num; y<=num;++y){
pen p=color_rational(x,y);
if(y>0){
pair far;
if(isPrimeWith(abs(x),abs(y)) ){
far=(x*100,y*100);
drawline(damier,(0,0),far,p);
}
}
if(y==0){
dot(damier,(x,y));
dot(damier,(x,y),rgb(0.9,0.9,0.9));
}else
dot(damier,(x,y),p);
}
}
dot(damier,(0,0));
dot(damier,(0,0),rgb(0.9,0.9,0.9));
add(damier.fit(),(0,0));
// drawing the equivalent classes
Licensing[edit]
Public domainPublic domainfalsefalse |
I, the copyright holder of this work, release this work into the public domain. This applies worldwide. In some countries this may not be legally possible; if so: I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law. |
Licensing[edit]
- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 20:55, 1 April 2015 | 629 × 629 (132 KB) | TomT0m (talk | contribs) | User created page with UploadWizard |
You cannot overwrite this file.
File usage on Commons
The following page uses this file:
File usage on other wikis
The following other wikis use this file:
- Usage on en.wikipedia.org
- Usage on sl.wikipedia.org
- Usage on sr.wikipedia.org
- Usage on tr.wikipedia.org
- Usage on vi.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 | 503pt |
---|---|
Height | 503pt |