<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Sierpinski Triangle on Nikhil&#39;s blog</title>
    <link>https://master--suspicious-stonebraker-7d2d21.netlify.app/tags/sierpinski-triangle/</link>
    <description>Recent content in Sierpinski Triangle on Nikhil&#39;s blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-US</language>
    <lastBuildDate>Mon, 04 Aug 2008 19:55:00 +0000</lastBuildDate>
    <atom:link href="https://master--suspicious-stonebraker-7d2d21.netlify.app/tags/sierpinski-triangle/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Sierpinski, my first fractal</title>
      <link>https://master--suspicious-stonebraker-7d2d21.netlify.app/post/2008/sierpinski-my-first-fractal/</link>
      <pubDate>Mon, 04 Aug 2008 19:55:00 +0000</pubDate>
      <guid>https://master--suspicious-stonebraker-7d2d21.netlify.app/post/2008/sierpinski-my-first-fractal/</guid>
      <description>The Sierpinski triangle in Python, inspired by HTDP, and using Pygame&#xA;import sys&#xA;import pygame&#xA;from pygame.locals import *&#xA;class Point(object):&#xA;def __init__(self, x, y):&#xA;self.x, self.y = x, y&#xA;def distance_sq(self, other):&#xA;return (self.x-other.x)**2 + (self.y-other.y)**2&#xA;def distance(self, other):&#xA;return sqrt(self.distance_sq(other))&#xA;def tupl(self):&#xA;return (self.x, self.y)&#xA;def midpt(p1, p2):&#xA;return Point( (p1.x+p2.x)/2, (p1.y+p2.y)/2 )&#xA;def too_small(p1, p2, p3):&#xA;return max([ p1.distance_sq(p2), p2.distance_sq(p3), p3.distance_sq(p1) ]) &amp;lt; 5&#xA;def draw_line(p1, p2, surf, col):</description>
    </item>
  </channel>
</rss>
