<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://fingswotidun.com/code/index.php?action=history&amp;feed=atom&amp;title=Useful_Bits</id>
		<title>Useful Bits - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://fingswotidun.com/code/index.php?action=history&amp;feed=atom&amp;title=Useful_Bits"/>
		<link rel="alternate" type="text/html" href="https://fingswotidun.com/code/index.php?title=Useful_Bits&amp;action=history"/>
		<updated>2026-11-15T02:49:52Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.24.2</generator>

	<entry>
		<id>https://fingswotidun.com/code/index.php?title=Useful_Bits&amp;diff=1356&amp;oldid=prev</id>
		<title>Lerc: Created page with &quot; &lt;edcode&gt; function graph(fn = x=&gt;x,options ={}) {   const {bounds = {left:10,top:10, width:400, height:400},          rangeX=[-1,+1], rangeY=[-1,+1] } = options;   let {left=1...&quot;</title>
		<link rel="alternate" type="text/html" href="https://fingswotidun.com/code/index.php?title=Useful_Bits&amp;diff=1356&amp;oldid=prev"/>
				<updated>2024-07-27T21:29:44Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot; &amp;lt;edcode&amp;gt; function graph(fn = x=&amp;gt;x,options ={}) {   const {bounds = {left:10,top:10, width:400, height:400},          rangeX=[-1,+1], rangeY=[-1,+1] } = options;   let {left=1...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
&amp;lt;edcode&amp;gt;&lt;br /&gt;
function graph(fn = x=&amp;gt;x,options ={}) {&lt;br /&gt;
  const {bounds = {left:10,top:10, width:400, height:400},&lt;br /&gt;
         rangeX=[-1,+1], rangeY=[-1,+1] } = options;&lt;br /&gt;
  let {left=10,top=10, width=400, height=400} = bounds;&lt;br /&gt;
  let [minX,maxX] = rangeX;&lt;br /&gt;
  let [minY,maxY] = rangeY;&lt;br /&gt;
  let rangeWidth = maxX-minX;&lt;br /&gt;
  let rangeHeight = maxY-minY;&lt;br /&gt;
  drawRectangle(left, top,width,height);&lt;br /&gt;
  &lt;br /&gt;
  let lastY = height/2;&lt;br /&gt;
  for(let tx=0; tx&amp;lt;width;tx++) {&lt;br /&gt;
    const x= (tx/width) * rangeWidth + minX;&lt;br /&gt;
    const y = fn(x);&lt;br /&gt;
    const screenY = (1-(y - minY)/rangeHeight) * height;&lt;br /&gt;
    &lt;br /&gt;
    drawLine(left+tx-1,top+lastY,left+tx,top+screenY);&lt;br /&gt;
    lastY=screenY;   &lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
graph(x=&amp;gt;Math.sin(x*4));&lt;br /&gt;
&amp;lt;/edcode&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lerc</name></author>	</entry>

	</feed>