sin()/cos()/tan() for kernel code? '_ 'a

Peter Jeremy peterjeremy at optushome.com.au
Sun Feb 11 10:13:09 UTC 2007


On 2007-Feb-11 00:39:29 -0800, "Eugene M. Kim" <freebsd.org at ab.ote.we.lv> wrote:
>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.

-- 
Peter Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20070211/9eb606df/attachment.pgp


More information about the freebsd-hackers mailing list