File:Fractal canopy.svg
From Wikimedia Commons, the free media repository
Jump to navigation
Jump to search
Size of this PNG preview of this SVG file: 600 × 600 pixels. Other resolutions: 240 × 240 pixels | 480 × 480 pixels | 768 × 768 pixels | 1,024 × 1,024 pixels | 2,048 × 2,048 pixels.
Original file (SVG file, nominally 800 × 800 pixels, file size: 229 KB)
File information
Structured data
Captions
Summary[edit]
DescriptionFractal canopy.svg |
English: Example of Fractal Canopy with angle=PI/11 and reduction factor=0.75 |
Date | |
Source | Own work |
Author | Claudio Rocchini |
Licensing[edit]
I, the copyright holder of this work, hereby publish it under the following license:
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
- 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.
Source Code[edit]
/* (C)2013 Claudio Rocchini, CC-BY 3.0 */
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <vector>
const double PI = 3.1415926535897932384626433832795;
class edge {
public:
double l,t,a,x,y;
edge() {}
edge( double nl, double nt, double na, double nx, double ny ) :
l(nl),t(nt),a(na),x(nx),y(ny) {}
};
int main() {
const double SX = 800; const double SY = 800;
const double a = PI/11; const double r = 0.75; const double minl = 10;
std::vector<edge> st;
st.push_back( edge(200,25,-PI/2,SX/2,SY-10) );
FILE * fo = fopen("fractal_canopy.svg","w");
fprintf(fo,
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n"
"<svg xmlns:svg=\"http://www.w3.org/2000/svg\" xmlns=\"http://www.w3.org/2000/svg\"\n"
"version=\"1.0\" width=\"%g\" height=\"%g\" id=\"fractal_canopy\">\n"
,SX,SY
);
double lastt = -1.0;
for(size_t i=0;i<st.size();++i) {
double nx = st[i].x+st[i].l*cos(st[i].a);
double ny = st[i].y+st[i].l*sin(st[i].a);
if(lastt!=st[i].t) {
if(lastt!=-1.0) fprintf(fo,"</g>\n");
lastt = st[i].t;
fprintf(fo,"<g style=\"stroke:#000000;stroke-width:%g;fill:none\">\n"
,lastt);
}
fprintf(fo,"<line x1=\"%6.2f\" y1=\"%6.2f\" x2=\"%6.2f\" y2=\"%6.2f\"/>\n"
,st[i].x,st[i].y,nx,ny);
if(st[i].l<=minl) continue;
st.push_back( edge(st[i].l*r,st[i].t*r,st[i].a+a,nx,ny) );
st.push_back( edge(st[i].l*r,st[i].t*r,st[i].a-a,nx,ny) );
}
fprintf(fo,"</g>\n");
fprintf(fo,"</svg>\n");
fclose(fo);
return 0;
}
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 10:41, 2 January 2013 | 800 × 800 (229 KB) | Rocchini (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 ca.wikipedia.org
- Usage on de.wikibooks.org
- Mathematrix: Aufgabensammlung/ Kurvendiskussion
- Mathematrix: Antworten nach Thema/ Differentialrechnung
- Mathematrix: Aufgabensammlung/ Textaufgaben zu den Grundrechenarten
- Mathematrix: Aufgabensammlung/ Grundrechenartenvorrang
- Mathematrix: Aufgabensammlung/ Strich und Punkt Bruchrechnungen
- Mathematrix: Aufgabensammlung/ Textaufgaben zu den Bruchrechnungen
- Mathematrix: Aufgabensammlung/ Wachstum
- Mathematrix: Aufgabensammlung/ Zerfall
- Mathematrix: AT PSA/ Theorie nach Thema/ Zahlendarstellungen Mengentheorie und Aussagenlogik
- Mathematrix: AT AHS/ Theorie nach Thema/ Vektoren
- Mathematrix: AT AHS/ Theorie nach Thema/ Differentialrechnung
- Mathematrix: AT BRP/ Wiederholung
- Mathematrix: AT BRP/ Prüfungsbeispiele/ Prozentrechnung
- Mathematrix: Kompass/ Exponential und Logarithmus Funktion
- Mathematrix: Kompass/ Arbeiten mit Termen
- Mathematrix: Kompass/ Zahlendarstellungen Mengentheorie und Aussagenlogik
- Mathematrix: Kompass/ Einheiten
- Mathematrix: Kompass/ Statistik und Wahrscheinlichkeitsrechnung
- Mathematrix: Kompass/ Geometrische Konstruktionen
- Mathematrix: Kompass/ Geometrie der Ebene
- Mathematrix: Kompass/ Geometrie des Raums
- Mathematrix: Kompass/ Diagramme
- Mathematrix: Kompass/ Funktionen
- Mathematrix: Kompass/ Lineare Gleichungssysteme
- Mathematrix: Kompass/ Trigonometrische Funktionen
- Mathematrix: Kompass/ Vektoren
- Mathematrix: Kompass/ Differentialrechnung
- Mathematrix: Kompass/ Integralrechnung
- Mathematrix/ Bilderverzeichnis
- Mathematrix: AT AHS/ Exponential und Logarithmus Funktion
- Mathematrix: AT AHS/ Prüfungsbeispiele/ Diagramme
- Usage on el.wikipedia.org
- Usage on en.wikipedia.org
- Usage on es.wikipedia.org
- Usage on fr.wikipedia.org
- Usage on tt.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 | 800 |
---|---|
Height | 800 |