<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Imaginary Part &#187; inkscape</title>
	<atom:link href="http://1.21jiggawatts.net/blog/tag/inkscape/feed/" rel="self" type="application/rss+xml" />
	<link>http://1.21jiggawatts.net/blog</link>
	<description>Just another Australian geek&#039;s perspective</description>
	<lastBuildDate>Thu, 29 Jul 2010 11:33:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Function Plotting in Inkscape</title>
		<link>http://1.21jiggawatts.net/blog/2009/09/function-plotting-in-inkscape/</link>
		<comments>http://1.21jiggawatts.net/blog/2009/09/function-plotting-in-inkscape/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 03:11:27 +0000</pubDate>
		<dc:creator>TK</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[inkscape]]></category>
		<category><![CDATA[maths]]></category>

		<guid isPermaLink="false">http://arctanx.id.au/blog/?p=86</guid>
		<description><![CDATA[Today I found myself needing to draw both a sine wave and a triangle wave accurately for a diagram in Inkscape. It turns out that all the required functionality is included, but you have to do a little work yourself. Here are my findings... The tool is called Function Plotter and can be found under [...]]]></description>
			<content:encoded><![CDATA[<p>Today I found myself needing to draw both a sine wave and a triangle wave accurately for a diagram in Inkscape. It turns out that all the required functionality is included, but you have to do a little work yourself. Here are my findings...</p>
<p>The tool is called <em>Function Plotter</em> and can be found under Effects | Render | Function Plotter...</p>
<p><strong>Sine Wave</strong></p>
<p>The sinusoid is easy to do.</p>
<p style="text-align: left;"><a href="http://arctanx.id.au/blog/wp-content/uploads/2009/09/sine_wave_cfg.png"><img class="size-medium wp-image-87 aligncenter" title="Sine Wave Function Plotter configuration" src="http://arctanx.id.au/blog/wp-content/uploads/2009/09/sine_wave_cfg-300x294.png" alt="Sine Wave Function Plotter configuration" width="180" height="176" /></a></p>
<ul>
<li>Draw a rectangle with the rectangle tool, select it, then open the Function Plotter.</li>
<li>Check the "Multiply x-range by 2*pi" box so the end x-value represents how many periods you want.</li>
<li>Adjust the y values of the top and bottom of your rectangle---if your sine wave has a peak value of 1 and you want it to take up the whole box, use +/- 1 here.</li>
<li>Make sure that "use polar coordinates" is unchecked.</li>
<li>Choose enough sample points to get a good looking sine wave. It evaluates your function at various points and makes an interpolating path. In this case I got a reasonable looking sine-wave with only 8 samples.</li>
<li>Put "sin(x)" into the Function area and click Apply.</li>
</ul>
<p style="text-align: left;">Your rectangle will turn into a sine wave, like this:</p>
<p style="text-align: left;"><a href="http://arctanx.id.au/blog/wp-content/uploads/2009/09/sine_wave.png"><img class="size-full wp-image-88 aligncenter" title="Sine Wave" src="http://arctanx.id.au/blog/wp-content/uploads/2009/09/sine_wave.png" alt="Sine Wave" width="160" height="113" /></a><strong>Triangle Wave</strong></p>
<p>You can't make a triangle wave directly, but it can be built up from simpler functions.</p>
<p><a href="http://arctanx.id.au/blog/wp-content/uploads/2009/09/triangle_wave_cfg.png"><img class="aligncenter size-medium wp-image-89" title="Triangle Wave Function Plotter configuration" src="http://arctanx.id.au/blog/wp-content/uploads/2009/09/triangle_wave_cfg-300x294.png" alt="Triangle Wave Function Plotter configuration" width="180" height="176" /></a></p>
<ul>
<li>Draw a rectangle which will contain the triangle wave.</li>
<li>Set the end x-value to the total number of peaks you want.</li>
<li>Set the bottom y-value to 0.0 and the top y-value to 1.0.</li>
<li>Choose a large-ish number of samples. You'll probably want at least 25 per peak. This is necessary to get tight corners on your triangle wave because Inkscape tries to smooth out lines between your points.</li>
<li>Make sure that both the "multiply by 2*pi" and "use polar coordinates" options are unchecked.</li>
<li>Put "-2*fabs(fmod(x,1)-0.5)+1" into the Function area and click Apply.</li>
</ul>
<p>Your rectangle will become a triangle wave like this one:</p>
<p style="text-align: left;"><a href="http://arctanx.id.au/blog/wp-content/uploads/2009/09/triangle_wave.png"><img class="aligncenter size-medium wp-image-90" title="Triangle Wave" src="http://arctanx.id.au/blog/wp-content/uploads/2009/09/triangle_wave-300x157.png" alt="Triangle Wave" width="180" height="94" /></a><strong>Conclusion</strong></p>
<p style="text-align: left;">Inkscape's function plotter is very powerful for drawing paths conforming to shapes which you can define mathematically. The "Functions" tab in the Function Plotter gives a list of the available functions. Have a play with it.</p>
]]></content:encoded>
			<wfw:commentRss>http://1.21jiggawatts.net/blog/2009/09/function-plotting-in-inkscape/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
