File:Cantor-Funktion.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file(SVG file, nominally 359 × 225 pixels, file size: 33 KB)

Captions

Captions

Add a one-line explanation of what this file represents

Summary[edit]

Description
English: Mathematica-Plot of the Cantor-Function (10 iterations)
Deutsch: Mathematica-Plot der Cantor-Funktion (10 Iterationen)
Date
Source Own work
Author Ljfa-ag

Source Code:

spawn[{a_Rational, b_Rational}] := 
 Module[{w = (b - a)/3}, {{a - 2 w, a - w}, {b + w, b + 2 w}}]
spawn[intervals_List] := spawn /@ intervals

f[0] = 0;
f[x_] := f[3 x]/2 /; x <= 1/3
f[x_] := 1 - f[1 - x] /; x >= 2/3
CantorFunctionIntervals[n_] := 
 CantorFunctionIntervals[n] = 
  Module[{intervals = 
     Flatten[Union[{0, 1}, 
       Cases[NestList[spawn, {1/3, 2/3}, 
         n], _Rational, \[Infinity]]]]}, intervals]

CantorFunctionPlot[n_, opts___] := 
 Module[{intervals = CantorFunctionIntervals[n]}, 
  ListPlot[Transpose[{intervals, f /@ intervals}], opts, 
   PlotJoined -> True, Axes -> True]]

CantorFunctionValues[n_] := 
 Module[{intervals = 
    CantorFunctionIntervals[n]}, {Transpose[{intervals, 
     f /@ intervals}]}]

CantorFunction[x_?NumericQ, n_: 5] := 
 f[Select[CantorFunctionIntervals[n], # >= x &, 1][[1]]]
Plot[CantorFunction[x, 10], {x, 0, 1}]

Licensing[edit]

I, the copyright holder of this work, hereby publish it under the following licenses:
GNU head Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.
w:en:Creative Commons
attribution share alike
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.
You may select the license of your choice.
Mathematica Logo 
This diagram was created with Mathematica.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current18:54, 2 August 2009Thumbnail for version as of 18:54, 2 August 2009359 × 225 (33 KB)Ljfa-ag (talk | contribs){{Information |Description={{en|1=Mathematica-Plot of the Cantor-Function (10 iterations)}} {{de|1=Mathematica-Plot der Cantor-Funktion (10 Iterationen)}} |Source=Eigenes Werk (own work) |Author=Ljfa-ag |Date=2009-08-02 |Permission= |othe

There are no pages that use this file.

File usage on other wikis