From owner-freebsd-hackers@FreeBSD.ORG Mon Feb 12 09:39:33 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 5724D16A400; Mon, 12 Feb 2007 09:39:33 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from redbull.bpaserver.net (redbullneu.bpaserver.net [213.198.78.217]) by mx1.freebsd.org (Postfix) with ESMTP id 0B8B713C46B; Mon, 12 Feb 2007 09:39:33 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from outgoing.leidinger.net (p54A5D789.dip.t-dialin.net [84.165.215.137]) by redbull.bpaserver.net (Postfix) with ESMTP id 4F77D2E1AE; Mon, 12 Feb 2007 10:30:56 +0100 (CET) Received: from webmail.leidinger.net (webmail.Leidinger.net [192.168.1.102]) by outgoing.leidinger.net (Postfix) with ESMTP id A64615B4B9B; Mon, 12 Feb 2007 10:16:33 +0100 (CET) Received: (from www@localhost) by webmail.leidinger.net (8.13.8/8.13.8/Submit) id l1C9GWvg035505; Mon, 12 Feb 2007 10:16:32 +0100 (CET) (envelope-from Alexander@Leidinger.net) Received: from pslux.cec.eu.int (pslux.cec.eu.int [158.169.9.14]) by webmail.leidinger.net (Horde MIME library) with HTTP; Mon, 12 Feb 2007 10:16:32 +0100 Message-ID: <20070212101632.qa3p4f5wkkoccsk0@webmail.leidinger.net> X-Priority: 3 (Normal) Date: Mon, 12 Feb 2007 10:16:32 +0100 From: Alexander Leidinger To: Stephen Montgomery-Smith References: <45CED641.7020608@ab.ote.we.lv> <20070211110815.O62469@math.missouri.edu> <20070211115815.O62469@math.missouri.edu> In-Reply-To: <20070211115815.O62469@math.missouri.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Internet Messaging Program (IMP) H3 (4.1.3) / FreeBSD-7.0 X-BPAnet-MailScanner-Information: Please contact the ISP for more information X-BPAnet-MailScanner: Found to be clean X-BPAnet-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-14.864, required 6, autolearn=not spam, BAYES_00 -15.00, DK_POLICY_SIGNSOME 0.00, FORGED_RCVD_HELO 0.14) X-BPAnet-MailScanner-From: alexander@leidinger.net X-Spam-Status: No X-Mailman-Approved-At: Mon, 12 Feb 2007 12:36:41 +0000 Cc: Daniel Eischen , "Eugene M. Kim" , 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: Mon, 12 Feb 2007 09:39:33 -0000 Quoting Stephen Montgomery-Smith (from =20 Sun, 11 Feb 2007 12:00:12 -0600 (CST)): > > > On Sun, 11 Feb 2007, Stephen Montgomery-Smith wrote: > >> >> >> On Sun, 11 Feb 2007, Daniel Eischen wrote: >>> Can't you do this in userland? Teach moused? >> >> Since you will only need sin and cos evaluated to the nearest =20 >> degree, if that, I suggest a simple look up table. There is also =20 >> something called the CORDIC method, I think, but I suspect that the =20 >> look up table will be so much easier to program, and negligable =20 >> extra space overhead. >> >> Stephen > > And if you do need more accuracy than the nearest degree, the formulae > > sin(x+h) =3D sin(x) + h cos(x); > cos(x+h) =3D cos(x) - h sin(x) > > for small h (say |h| less than half a degree) should provide way more > accuracy than you should need. There's work underway which moves the hard work of the mouse drivers =20 from the kernel to moused. The kernel just has a simple hardware =20 interface there, and the real interpretion of all the stuff from the =20 mouse happens in the userland. See http://www.semicomplete.com/projects/newpsm/ for more. So maybe it would be better to implement this in moused right from the =20 beginning... Bye, Alexander. --=20 Love is never asking why? http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID =3D B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID =3D 72077137