<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wikidot="http://www.wikidot.com/rss-namespace">

	<channel>
		<title>Rendering curves in grayscale</title>
		<link>http://kogics.wikidot.com/forum/t-229372/rendering-curves-in-grayscale</link>
		<description>Posts in the discussion thread &quot;Rendering curves in grayscale&quot; - Adapted from a Processing example, applies four different composed functions to sequence of radian values from 0 to pi and renders each as a grayscale gradient.</description>
				<copyright></copyright>
		<lastBuildDate>Thu, 12 Mar 2026 23:20:05 +0000</lastBuildDate>
		
					<item>
				<guid>http://kogics.wikidot.com/forum/t-229372#post-735313</guid>
				<title>Re: Rendering curves in grayscale</title>
				<link>http://kogics.wikidot.com/forum/t-229372/rendering-curves-in-grayscale#post-735313</link>
				<description></description>
				<pubDate>Fri, 26 Mar 2010 16:34:21 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>It can get confusing! We don't have our story fully worked out there yet&#8230;</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-229372#post-735308</guid>
				<title>Re: Rendering curves in grayscale</title>
				<link>http://kogics.wikidot.com/forum/t-229372/rendering-curves-in-grayscale#post-735308</link>
				<description></description>
				<pubDate>Fri, 26 Mar 2010 16:31:07 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Great!</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-229372#post-733487</guid>
				<title>Re: Rendering curves in grayscale</title>
				<link>http://kogics.wikidot.com/forum/t-229372/rendering-curves-in-grayscale#post-733487</link>
				<description></description>
				<pubDate>Wed, 24 Mar 2010 20:04:15 +0000</pubDate>
				<wikidot:authorName>Peter Lewerin</wikidot:authorName>				<wikidot:authorUserId>459742</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Ah. I registered with Kogics, not Wikidot. Silly me. :)</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-229372#post-733484</guid>
				<title>Re: Rendering curves in grayscale</title>
				<link>http://kogics.wikidot.com/forum/t-229372/rendering-curves-in-grayscale#post-733484</link>
				<description></description>
				<pubDate>Wed, 24 Mar 2010 20:01:56 +0000</pubDate>
				<wikidot:authorName>Peter Lewerin</wikidot:authorName>				<wikidot:authorUserId>459742</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Will do &#8212;- I went through the Processing examples last autumn, porting them to Scala to evaluate the environment. I intend to see if I can use those ports in Kojo.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-229372#post-733424</guid>
				<title>Re: Rendering curves in grayscale</title>
				<link>http://kogics.wikidot.com/forum/t-229372/rendering-curves-in-grayscale#post-733424</link>
				<description></description>
				<pubDate>Wed, 24 Mar 2010 19:00:00 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <blockquote> <p>BTW, I registered an account and logged in, but I post as a guest. Is there something else I must to to post as a<br /> user, or is there just a delay?</p> </blockquote> <p>You should be able to post as a registered (wikidot) user. When you're logged in, and you try to post something, you should not see fields such as name, email id etc on the posting page (those show up for anonymous users only).</p> <p>Try again (maybe after restarting your browser), and let's see if it works out for you&#8230;</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-229372#post-733403</guid>
				<title>Re: Rendering curves in grayscale</title>
				<link>http://kogics.wikidot.com/forum/t-229372/rendering-curves-in-grayscale#post-733403</link>
				<description></description>
				<pubDate>Wed, 24 Mar 2010 18:41:58 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Very cool! And very functional!</p> <p>It's almost scary to see someone using the Canvas API to such good effect - I have not had a chance to put in too much work at all into the implementation of that API.</p> <p>If you identify anything that you consider to be pretty useful that is missing from the API, do let me know.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-229372#post-733204</guid>
				<title>Re: Rendering curves in grayscale</title>
				<link>http://kogics.wikidot.com/forum/t-229372/rendering-curves-in-grayscale#post-733204</link>
				<description></description>
				<pubDate>Wed, 24 Mar 2010 15:01:08 +0000</pubDate>
				<wikidot:authorName>Peter Lewerin</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>The last line should of course be</p> <div class="code"> <pre><code>render (0) { cos _ andThen abs andThen f }</code></pre></div> <p>BTW, I registered an account and logged in, but I post as a guest. Is there something else I must to to post as a user, or is there just a delay?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-229372#post-733200</guid>
				<title>Rendering curves in grayscale</title>
				<link>http://kogics.wikidot.com/forum/t-229372/rendering-curves-in-grayscale#post-733200</link>
				<description></description>
				<pubDate>Wed, 24 Mar 2010 14:54:12 +0000</pubDate>
				<wikidot:authorName>Peter Lewerin</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <div class="code"> <pre><code>import Math._ import java.awt.Color._ clear invisible val width = 180 val height = 25 val halfwave = Vector.tabulate(width){ i =&gt; toRadians(i) } def render (level: Int)(fn: Double =&gt; Double) { val y0 = level * height val y1 = (level + 1) * height (halfwave map fn zipWithIndex) foreach { case(e, i) =&gt; val c = e.toFloat Canvas.setPenColor(new Color(c, c, c)) Canvas.line(i, y0, i, y1) } } val f = { x: Double =&gt; 1 - x } render (3) { sin } render (2) { sin _ andThen f } render (1) { cos _ andThen abs } render (0) { cos _ andThen abs andThen { x =&gt; 1 - x } }</code></pre></div> 
				 	]]>
				</content:encoded>							</item>
				</channel>
</rss>