From owner-freebsd-hackers@FreeBSD.ORG Sun Feb 11 14:54:36 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 5F84A16A400 for ; Sun, 11 Feb 2007 14:54:36 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.freebsd.org (Postfix) with ESMTP id D761413C478 for ; Sun, 11 Feb 2007 14:54:35 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.ntplx.net (8.13.8/8.13.8/NETPLEX) with ESMTP id l1BEiBof009045; Sun, 11 Feb 2007 09:44:11 -0500 (EST) X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.ntplx.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-3.0 (mail.ntplx.net [204.213.176.10]); Sun, 11 Feb 2007 09:44:11 -0500 (EST) Date: Sun, 11 Feb 2007 09:44:11 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: "Eugene M. Kim" In-Reply-To: <45CED641.7020608@ab.ote.we.lv> Message-ID: References: <45CED641.7020608@ab.ote.we.lv> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed 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 Reply-To: Daniel Eischen 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 14:54:36 -0000 On Sun, 11 Feb 2007, Eugene M. Kim wrote: > Hello all, > > I am writing a mouse device driver for my Wacom tablet (Intuos 2 9x12). > The tablet comes with a mouse and I managed to get valid coordinate data > from the device. However, unlike usual mice, the coordinate system is > tied not to the orientation of the mouse itself, but to the tablet, > which acts much like a "mouse pad". So, for example, if I rotate the > mouse 30 degrees to the left and move it left and right, the mouse > cursor would move not horizontally, but to 2- or 8-o'clock. > > 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? Can't you do this in userland? Teach moused? -- DE