Date: Sun, 11 Feb 2007 21:12:58 +1100 From: Peter Jeremy <peterjeremy@optushome.com.au> To: "Eugene M. Kim" <freebsd.org@ab.ote.we.lv> Cc: hackers@freebsd.org Subject: Re: sin()/cos()/tan() for kernel code? '_ 'a Message-ID: <20070211101258.GB834@turion.vk2pj.dyndns.org> In-Reply-To: <45CED641.7020608@ab.ote.we.lv> References: <45CED641.7020608@ab.ote.we.lv>
next in thread | previous in thread | raw e-mail | index | archive | help
--cfJ13FhsvNR/yOpm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2007-Feb-11 00:39:29 -0800, "Eugene M. Kim" <freebsd.org@ab.ote.we.lv> w= rote: >Fortunately the mouse also provides orientation data along with >coordinate data, so the correct cursor movement could be calculated from >it. The problem: The calculation needs trigonometry, but there seems to >be no math library support in the kernel (I ran "grep -w cos" on the >-CURRENT source tree, which turned nothing up). > >Does anyone have an idea on how to do this? Floating point is not allowed in the kernel. I suggest you look up "cordic" in google. This is an efficient way to do fixed-point trigonometry. --=20 Peter Jeremy --cfJ13FhsvNR/yOpm Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFFzuwq/opHv/APuIcRAhooAJ90Nhr45qfarkLPgd1xCJQK+rvySACeNOyO BBbk3Ncd3FUCLXneDFDagmA= =RIRK -----END PGP SIGNATURE----- --cfJ13FhsvNR/yOpm--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070211101258.GB834>