<DIV style="font-family:Arial, sans-serif; font-size:10pt;">Looks like a first-order Taylor series expansion.<BR><BR>The assumption is that you are underflowing on the second term.<DIV><BR></DIV><DIV>From a signal processing point-of-view, you are generally better off calculating to the maximum precision you have available, including the (appropriately-scaled) rounding, and THEN truncating down to your final desired range.</DIV><DIV><BR></DIV><DIV>Also, division is usually frowned upon in DSP work, because DSP chips don't usually have hardware dividers. They do have single-cycle hardware multipliers.</DIV><DIV><BR></DIV><DIV>--John</DIV><DIV><BR>--- joerg.straube@iaeth.ch wrote:<BR><BR>From: Jörg <joerg.straube@iaeth.ch><BR>To: ETH Oberon and related systems <oberon@lists.inf.ethz.ch><BR>Subject: Re: [Oberon] Oberon-7 - Circle Segments<BR>Date: Wed, 20 Feb 2019 13:37:01 +0100<BR><BR><DIV><P><SPAN lang="EN-US">Tomas</SPAN></P><P><SPAN lang="EN-US"> </SPAN></P><P><SPAN lang="EN-US">Just for completeness: </SPAN><SPAN lang="EN-US" style="font-family:"Apple Color Emoji"">☺</SPAN><SPAN lang="EN-US"></SPAN></P><P><SPAN lang="EN-US">The formula c := (r * 181 + 104) DIV 209; [now with correct rounding] calculates the HourTicks absolutely correctly for all circles with radius “r” up to 780 pixels.</SPAN></P><P><SPAN lang="EN-US">The formula c := (r * 71 + 41) DIV 82; is correct for circles with radius “r” up to 140 pixels. For larger circles it’s good as well, but sometimes off by one pixel.</SPAN></P><P><SPAN lang="EN-US"> </SPAN></P><P><SPAN lang="EN-US">br</SPAN></P><P><SPAN lang="EN-US">Jörg</SPAN></P><P><SPAN lang="EN-US"> </SPAN></P></DIV>
--
<A href="/eonapps/ft/wm/page/compose?send_to=Oberon%40lists.inf.ethz.ch">Oberon@lists.inf.ethz.ch</A> mailing list for ETH Oberon and related systems
<A href="https://lists.inf.ethz.ch/mailman/listinfo/oberon">https://lists.inf.ethz.ch/mailman/listinfo/oberon</A>
</DIV></DIV>