From owner-freebsd-hackers@FreeBSD.ORG Sun Feb 11 10:13:09 2007 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 69A4816A402 for ; Sun, 11 Feb 2007 10:13:09 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from turion.vk2pj.dyndns.org (c220-239-3-125.belrs4.nsw.optusnet.com.au [220.239.3.125]) by mx1.freebsd.org (Postfix) with ESMTP id EF64413C442 for ; Sun, 11 Feb 2007 10:13:08 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from turion.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by turion.vk2pj.dyndns.org (8.13.8/8.13.8) with ESMTP id l1BACxK9019189; Sun, 11 Feb 2007 21:12:59 +1100 (EST) (envelope-from peter@turion.vk2pj.dyndns.org) Received: (from peter@localhost) by turion.vk2pj.dyndns.org (8.13.8/8.13.8/Submit) id l1BACwqj019188; Sun, 11 Feb 2007 21:12:58 +1100 (EST) (envelope-from peter) Date: Sun, 11 Feb 2007 21:12:58 +1100 From: Peter Jeremy To: "Eugene M. Kim" Message-ID: <20070211101258.GB834@turion.vk2pj.dyndns.org> References: <45CED641.7020608@ab.ote.we.lv> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cfJ13FhsvNR/yOpm" Content-Disposition: inline In-Reply-To: <45CED641.7020608@ab.ote.we.lv> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.13 (2006-08-11) Cc: hackers@freebsd.org Subject: Re: sin()/cos()/tan() for kernel code? '_ 'a X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2007 10:13:09 -0000 --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" 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--