Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Feb 2007 10:16:32 +0100
From:      Alexander Leidinger <Alexander@Leidinger.net>
To:        Stephen Montgomery-Smith <stephen@math.missouri.edu>
Cc:        Daniel Eischen <deischen@freebsd.org>, "Eugene M. Kim" <freebsd.org@ab.ote.we.lv>, hackers@freebsd.org
Subject:   Re: sin()/cos()/tan() for kernel code?  '_ 'a
Message-ID:  <20070212101632.qa3p4f5wkkoccsk0@webmail.leidinger.net>
In-Reply-To: <20070211115815.O62469@math.missouri.edu>
References:  <45CED641.7020608@ab.ote.we.lv> <Pine.GSO.4.64.0702110941580.19880@sea.ntplx.net> <20070211110815.O62469@math.missouri.edu> <20070211115815.O62469@math.missouri.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
Quoting Stephen Montgomery-Smith <stephen@math.missouri.edu> (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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070212101632.qa3p4f5wkkoccsk0>