0543: "Sierpinski Valentine"

This forum is for the individual discussion thread that goes with each new comic.

Moderators: Moderators General, Prelates, Magistrates

User avatar
leveldeaded
Posts: 16
Joined: Mon Jan 05, 2009 3:27 am UTC
Contact:

Re: Sierpinski Valentine

Postby leveldeaded » Mon Feb 16, 2009 5:41 pm UTC

dennisw wrote:
Zer088 wrote:I guess that means we iphone users are mediocre[/tear]

Don't feel bad. You're not alone. Opera Mobile on my WinMo phone won't display it either. People who use Firefox prior to version 3 only see a truncated version of the title text, IIRC.

You can see the title text on your iPhone (as well as create a printable version on your computer) if you use my printifier.com



You can just look at the Comic Thread instead of the comic itself on your iphone, and get the mouseover text printed out nicely for you. See how much I trust my Comic thread forum?

feldgendler
Posts: 27
Joined: Fri Feb 13, 2009 9:49 pm UTC
Location: Oslo, Norway
Contact:

Re: "Sierpinski Valentine" Discussion

Postby feldgendler » Mon Feb 16, 2009 7:56 pm UTC

One day,
A mad meta-poet
With nothing to say
Wrote a mad meta-poem
That started: “One day,
A mad meta-poet
With nothing to say
Wrote a mad meta-poem
That started: “One day,
[...]
sort of close”,
Were the words that the poet
Finally chose
To bring his mad poem
To some sort of close”,
Were the words that the poet
Finally chose
To bring his mad poem
To some sort of close”.


I hope it's obvious how this is relevant to the topic.

orbus
Posts: 3
Joined: Sat Feb 14, 2009 7:41 pm UTC

Re: "Sierpinski Valentine" Discussion

Postby orbus » Mon Feb 16, 2009 10:17 pm UTC

Marleen wrote:Orbus & mezz, your renderings are stunningly beautiful.


Thanks! Having other people enjoy it really justifies the time I spent hacking mine together. =) (And I agree, Mezz's is really cool, too - it reminds me of something out of Psychonauts, especially in that color scheme.)

Speaking of hacking it together, there's a bug in the earlier version - I'd messed up, which is why hearts in the upper portion of the fractal that were off the center-line looked less heart-y and more blob-y.

It's a few lines of code, and one new rule added to tune the positioning, and now all the hearts look like hearts. =)

Code: Select all

    startshape OuterTriad

    rule RedSquare {
       SQUARE {hue 0 sat 1 b 1 alpha -0.95}
    }

    rule OuterTriad {
       RedSquare{}
       OuterIndentTriad {s 0.5 x 0.25 y -0.25 flip 90}
       OuterIndentTriad {s 0.5 x -0.25 y -0.25}
       Triad {s 0.5 y 0.25}
    }

    rule Triad {
       RedSquare{}
       SkewTriad {s 0.5 x 0.25 y -0.25 flip 90}
       SkewTriad {s 0.5 x -0.25 y -0.25}
       Triad {s 0.5 y 0.25}
    }

    rule SkewTriad {
       RedSquare{}
       LowerBentIndentTriad {s 0.5 x 0.25 y -0.25}
       BentTriad {s 0.5 x -0.25 y -0.25}
       UpperIndentTriadB {s 0.5 y 0.25}
    }
       
    rule BentTriad {
       RedSquare{}
       SkewTriad {
          size 1 (1 / (1 +( tan (25) / 2)))
          y ((tan (25) / 4) -.023)
          skew 0 25
       }
    }

    rule OuterIndentTriad {
       RedSquare{}
       LowerOuterIndentTriad {s 0.5 x 0.25 y -0.25}
       OuterIndentTriad {s 0.5 x -0.25 y -0.25}
       UpperIndentTriad {s 0.5 y 0.25}
    }

    rule LowerOuterIndentTriad {
       RedSquare{}
       OuterIndentTriad {
          x (- tan(15) / 2)
          size 1
          skew -15 0
       }
    }

    rule UpperIndentTriad {
       RedSquare{}
       Triad {
          skew 10 0
          size .74 1
          x -.07
       }
    }

    rule UpperIndentTriadB {
       RedSquare{}
       Triad {
          skew 8 0
          size .78 1
          x -.05
       }
    }

    rule LowerBentIndentTriad {
       RedSquare{}
       BentTriad {
          x (- tan(15) / 2 +.055)
          size 0.91 1
          skew -15 0
          flip 90
       }
    }

    rule UpperIndentSkewTriad {
       RedSquare{}
       SkewTriad {
          skew 8 0
          size .8 1
          x -.05
       }
    }


Image
Contractually Obligated Link to Flickr

mezz
Posts: 22
Joined: Fri Oct 06, 2006 4:55 am UTC
Location: CA, USA
Contact:

Re: Sierpinski Valentine

Postby mezz » Mon Feb 16, 2009 10:44 pm UTC

Marleen wrote:Orbus & mezz, your renderings are stunningly beautiful.

Thank you :) I'm glad you liked it.

dennisw wrote:The linked picture looks vaguely Giger-esque.
aterimperator wrote:
mezz wrote:I also have a nicer heart fractal I made a long time ago:
http://img.photobucket.com/albums/v33/m ... y-copy.jpg


Hmm, that's really quite good. May I ask how it was formed?

I made it using apophysis.
Most people find the learning curve a bit daunting, but it's fun.

Here is how the basic heart is made:
make a new flame, set the first transform to linear = 0, blur = 1,
make a final transform of linear = 0, julianscope = 1,
move the final transform up and to the right.

Or just open up the program and ctrl-v the following into it (there's no specific place to paste, it will accept it anywhere):

Code: Select all

<flame name="heart" version="Apophysis 2.08 beta" size="600 600" center="0 0" scale="150" oversample="1" filter="0.2" quality="1" background="0 0 0" brightness="4" gamma="4" >
   <xform weight="0.5" color="0" blur="1" coefs="1 0 0 1 0 0" />
   <finalxform color="0" symmetry="1" juliascope="1" coefs="1 0 0 1 0.18 -0.7" juliascope_power="2" juliascope_dist="1" />
   <palette count="1" format="RGB">FF69B4</palette>
</flame>
</Flames>

That's the start. Just build up from there ;)
There's a hole in the center, but I just photoshopped it.

User avatar
sableye22
Posts: 38
Joined: Sun Dec 21, 2008 10:37 pm UTC
Location: YOUR MO-- forget it.

Re: "Sierpinski Valentine" Discussion

Postby sableye22 » Tue Feb 17, 2009 12:03 am UTC

feldgendler wrote:One day,
A mad meta-poet
With nothing to say
Wrote a mad meta-poem
That started: “One day,
A mad meta-poet
With nothing to say
Wrote a mad meta-poem
That started: “One day,
[...]
sort of close”,
Were the words that the poet
Finally chose
To bring his mad poem
To some sort of close”,
Were the words that the poet
Finally chose
To bring his mad poem
To some sort of close”.


I hope it's obvious how this is relevant to the topic.


I get it. Ha. :D
You don't have to spend, you just have to pretend.

FatPhil
Posts: 3
Joined: Tue Feb 17, 2009 3:23 pm UTC

Re: "Sierpinski Valentine" Discussion

Postby FatPhil » Tue Feb 17, 2009 6:42 pm UTC

I must say that I do like the very different approaches people have used to generate mathematically-modelled, rather than simply artistic, fractals.

My post count is zero currently, so won't post a link to my own humble offering quite yet, but if you are impatient and have the nouse to track my website down, there's a directory called images on my website and a file called heart7.png ;-) . Of course, a real link will follow as soon as I can meaningfully contribute to a few more threads. Good work all - in particular the orinal and artistic best!

And the real link would be this:
Image

aterimperator
Posts: 62
Joined: Mon Feb 16, 2009 3:53 pm UTC

Re: Sierpinski Valentine

Postby aterimperator » Wed Feb 18, 2009 6:09 pm UTC

Ubik wrote:Is that a love triangle?

Ha, I missed this the first time through...


Anyway, I was thinking about this problem, and would one good approach be that of a sort of "canonball problem"? I.e. what you have is a triangle, and the problem is how to most effectively remove all area via cardiods? This could solve the warping problem, though it might result in something looking a lot less like a Sierpinski fractal.

orbus
Posts: 3
Joined: Sat Feb 14, 2009 7:41 pm UTC

Re: "Sierpinski Valentine" Discussion

Postby orbus » Wed Feb 18, 2009 7:29 pm UTC

feldgendler wrote:One day...


I really don't see why you felt the need to elide the middle portion of your poem! Surely we're all mature adults, there's no need for censorship here!

Here, I've taken the liberty of typesetting the whole thing for you and re-posting it.

Image
Larger Version

In all seriousness, thanks to feldgendler for posting the poem, and to Douglas Hofstadter for originally suggesting this method of textual abuse. Very simply, each sub-iteration of the poem is printed at 2/3 the size of the parent, which rapidly trends to pixel-dust - though, if we had infinite resolution, there's no reason not to have "poems all the way down," to steal a phrase.

If you want the source, just ask - I'm not posting it because it's terribly long and tedious. The "fractal source" - the heart of the trick - is about three lines of elegance, while convincing Context Free to render letterforms and words is about a thousand lines of kludgy library. (It is, however, reusable, so if anyone besides me wants to abuse CFDG for producing text, I'll happily share it and save having to duplicate the effort.)

tunah
Posts: 1
Joined: Sun Oct 19, 2008 1:38 pm UTC

Re: "Sierpinski Valentine" Discussion

Postby tunah » Thu Feb 19, 2009 4:50 am UTC

Image
(click for full)

I wrote some code that uses the borders of the heart to deform triangular meshes that describe the shape of each of the corner sections of the gasket. You can translate a point on the triangular gasket to the equivalent point on the heart-shaped one by finding the corner it lies in, recursively finding its position within that gasket, and then transforming it using the mesh.

Then the actual shape was drawn with the random walk.

The functions wrapped around the triangle were
y = -R/2 + √(R^2 - (|x-0.5| - R)^2)
and
y = x tan (2A - π/6), x≤0.72046,
y = 1+√3/2 + √(R^2 - (x + √3 - 5/2)), x>0.72046

thenotestaken
Posts: 10
Joined: Sun Dec 07, 2008 4:41 am UTC
Location: Montréal, QC

Re: "Sierpinski Valentine" Discussion

Postby thenotestaken » Thu Feb 19, 2009 7:19 am UTC

What an awesome thread! Valentines are a great use of coding/math skills, though I have to ask--did any of you actually use these for a special someone?

feldgendler
Posts: 27
Joined: Fri Feb 13, 2009 9:49 pm UTC
Location: Oslo, Norway
Contact:

Re: "Sierpinski Valentine" Discussion

Postby feldgendler » Thu Feb 19, 2009 8:04 am UTC

orbus: the poem indeed makes a much stronger impression without omissions! Thanks for publishing your typesetting excercise.

BTW, credits for the poem itself go to an anonymous author. I saw it from UNIX fortune.

User avatar
Marleen
Posts: 53
Joined: Fri Jul 18, 2008 9:17 am UTC
Location: Germany

Re: "Sierpinski Valentine" Discussion

Postby Marleen » Thu Feb 19, 2009 9:31 am UTC

I'm impressed.

I love the meta-poem.

I love the new Sierpinski hearts.

User avatar
dennisw
Posts: 441
Joined: Wed Nov 05, 2008 9:09 am UTC
Location: Appearing pro se AND pro bono!
Contact:

Re: "Sierpinski Valentine" Discussion

Postby dennisw » Thu Feb 19, 2009 4:46 pm UTC

Marleen wrote:I'm impressed.

I love the meta-poem.

I love the new Sierpinski hearts.

boom-de-yada
Try the Printifier for xkcd. You can now scale the comic between 50 and 150%.

I find these very useful: Common Errors in English Usage (web site) and Eats, Shoots & Leaves (book). You may, too.

e pluribus unum
Unleash unlicensed ungulates!

Faranya
Posts: 259
Joined: Tue Nov 18, 2008 3:10 am UTC

Re: "Sierpinski Valentine" Discussion

Postby Faranya » Fri Feb 20, 2009 2:14 am UTC

Aww, my valentine was nothing as great as this one though...

All it had was a set of labeled axis and a piecewise function of two quadratics and an absolute function into the shape of a heart...

Oh well, maybe next year...
Image

tahrey
Posts: 94
Joined: Tue Nov 25, 2008 9:48 am UTC

Re: "Sierpinski Valentine" Discussion

Postby tahrey » Fri Feb 20, 2009 11:06 am UTC

Loli haet valentines day

But I love these fractals, they give the requisite warm fuzzy feeling.

And make me feel like it's 1995 all over again.

User avatar
martin878
Posts: 63
Joined: Mon Nov 03, 2008 12:47 pm UTC
Location: Oxford, UK

Re: Sierpinski Valentine

Postby martin878 » Mon Feb 23, 2009 5:52 pm UTC

mezz wrote:I made it using apophysis.
Most people find the learning curve a bit daunting, but it's fun.


I agree. You inspired me to start playing with it:

Spoiler:
Apophysis-090223-202.jpg
Fractal flame that looks like a plant
Apophysis-090223-202.jpg (99.21 KiB) Viewed 5368 times

aterimperator
Posts: 62
Joined: Mon Feb 16, 2009 3:53 pm UTC

Re: Sierpinski Valentine

Postby aterimperator » Fri Feb 27, 2009 4:41 pm UTC

martin878 wrote:
mezz wrote:I made it using apophysis.
Most people find the learning curve a bit daunting, but it's fun.

I agree. You inspired me to start playing with it:


Needs to be brighter further away from the edges.

xdaemanix
Posts: 15
Joined: Sat Dec 29, 2007 12:38 am UTC
Location: Whorlando, FL
Contact:

Re: "Sierpinski Valentine" Discussion

Postby xdaemanix » Wed Mar 11, 2009 4:55 am UTC

aw not going on the internet for a few weeks sucked.... im late... but the rollover text made me ^.^
There's no sense crying over every mistake. You just keep on trying 'til you run out of cake.

makc
Posts: 181
Joined: Mon Nov 02, 2009 12:26 pm UTC

Re: "Sierpinski Valentine" Discussion

Postby makc » Sun Feb 14, 2010 2:07 am UTC

it is that time of the year again :) I am writing a program to fit hearts into free space using sort of GA (a fancy name for random search, basically). Not perfect yet (see arrows) but I am getting close.....
Attachments
1.gif
1.gif (6.75 KiB) Viewed 4607 times


Return to “Individual XKCD Comic Threads”

Who is online

Users browsing this forum: No registered users and 84 guests