Sysse [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=89111 Trigfunction behave unexpected [Not input range-, bu maybe inverted sin-related) <p>I've started up a new project and I'll be making extensive use of the trig-functions, so I started playing around with them. I soon found out about the input range and the inverted sin, but I still can not explain the behavior I'm seeing.</p> <p>What you would expect from sin(x)<em>cos(x) and what you can intuitively read from the graph is that first peak of sin(x)</em>cos(x) should be negative, and the second positive. The actual behavior can be explained by the inverted sin-function, but with the inverted sin-function, I would expect the sin-graph to reflect the inversion, which it does not.</p> <img style="margin-bottom:16px" border=0 src="/media/89111/sincosprob.PNG" alt="" /> <p>Code:</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>function _draw() cls() print(&quot;cos(x)&quot;,10) print(&quot;sin(x)&quot;,12) print(&quot;sin(x)*cos(x)&quot;,14) for x=1, 127 do pset(x, 64,3) pset(x, 64+32*cos(x/127),10) pset(x, 64+32*sin(x/127),12) pset(x, 64+32*sin(x/127)*cos(x/127),14) end end</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>(Sorry, I don't know how to format code on the BBS)</p> https://www.lexaloffle.com/bbs/?tid=139930 https://www.lexaloffle.com/bbs/?tid=139930 Mon, 22 Jan 2024 10:51:31 UTC Kons 1.0.1 <p> <table><tr><td> <a href="/bbs/?pid=140365#p"> <img src="/bbs/thumbs/pico8_kons-2.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=140365#p"> Kons 1.0.1</a><br><br> by <a href="/bbs/?uid=89111"> Sysse</a> <br><br><br> <a href="/bbs/?pid=140365#p"> [Click to Play]</a> </td></tr></table> <table><tr><td> <a href="/bbs/?pid=140365#p"> <img src="/bbs/thumbs/pico8_kons-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=140365#p"> Kons 1.0</a><br><br> by <a href="/bbs/?uid=89111"> Sysse</a> <br><br><br> <a href="/bbs/?pid=140365#p"> [Click to Play]</a> </td></tr></table> <br /> First release of my first game (in any engine/platform).</p> <p>It's basically Snake, but you grow automatically and have to consume healthy fruit and vitamins to stay short.</p> <p>Version 1.0.1<br /> Added a border to the screen to help see where the edges are</p> https://www.lexaloffle.com/bbs/?tid=139909 https://www.lexaloffle.com/bbs/?tid=139909 Sat, 20 Jan 2024 15:44:19 UTC