From owner-freebsd-hackers@FreeBSD.ORG Sun Feb 11 08:59:03 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 0627716A406 for ; Sun, 11 Feb 2007 08:59:03 +0000 (UTC) (envelope-from freebsd.org@ab.ote.we.lv) Received: from purple.the-7.net (purple.the-7.net [64.71.156.34]) by mx1.freebsd.org (Postfix) with ESMTP id E0F1A13C494 for ; Sun, 11 Feb 2007 08:59:00 +0000 (UTC) (envelope-from freebsd.org@ab.ote.we.lv) Received: from seerajeane.astralblue.net (seerajeane.astralblue.net [IPv6:2001:470:1f00:3605:2e0:81ff:fe51:1e73]) by purple.the-7.net (8.13.8/8.13.8) with ESMTP id l1B8dLgs045026 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-SHA bits=256 verify=OK) for ; Sun, 11 Feb 2007 00:39:22 -0800 (PST) (envelope-from freebsd.org@ab.ote.we.lv) Authentication-Results: purple.the-7.net from=freebsd.org@ab.ote.we.lv; sender-id=neutral; spf=neutral Received: from [IPv6:::1] (seerajeane.astralblue.net [IPv6:::1]) by seerajeane.astralblue.net (8.13.8/8.13.8) with ESMTP id l1B8dTsQ036568 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-SHA bits=256 verify=NO) for ; Sun, 11 Feb 2007 00:39:30 -0800 (PST) (envelope-from freebsd.org@ab.ote.we.lv) Message-ID: <45CED641.7020608@ab.ote.we.lv> Date: Sun, 11 Feb 2007 00:39:29 -0800 From: "Eugene M. Kim" User-Agent: Thunderbird 1.5.0.8 (X11/20061202) MIME-Version: 1.0 To: hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.0 required=10.0 tests=NO_RELAYS autolearn=disabled version=3.1.1 X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on purple.the-7.net Cc: Subject: 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 08:59:03 -0000 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? Cheers, Eugene