Re: sin()/cos()/tan() for kernel code? '_ 'a
- From: Alexander Leidinger <Alexander@xxxxxxxxxxxxx>
- Date: Mon, 12 Feb 2007 10:16:32 +0100
Quoting Stephen Montgomery-Smith <stephen@xxxxxxxxxxxxxxxxx> (from 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 degree, if that, I suggest a simple look up table. There is also something called the CORDIC method, I think, but I suspect that the look up table will be so much easier to program, and negligable extra space overhead.
Stephen
And if you do need more accuracy than the nearest degree, the formulae
sin(x+h) = sin(x) + h cos(x);
cos(x+h) = 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 from the kernel to moused. The kernel just has a simple hardware interface there, and the real interpretion of all the stuff from the 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 beginning...
Bye,
Alexander.
--
Love is never asking why?
http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137
_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"
- Follow-Ups:
- Re: sin()/cos()/tan() for kernel code? '_ 'a
- From: Jordan Sissel
- Re: sin()/cos()/tan() for kernel code? '_ 'a
- References:
- sin()/cos()/tan() for kernel code? '_ 'a
- From: Eugene M. Kim
- Re: sin()/cos()/tan() for kernel code? '_ 'a
- From: Daniel Eischen
- Re: sin()/cos()/tan() for kernel code? '_ 'a
- From: Stephen Montgomery-Smith
- Re: sin()/cos()/tan() for kernel code? '_ 'a
- From: Stephen Montgomery-Smith
- sin()/cos()/tan() for kernel code? '_ 'a
- Prev by Date: Re: FreeSBIE DVD with KDE,Gnome,Java,OpenOffice.org et al?
- Next by Date: Re: sin()/cos()/tan() for kernel code? '_ 'a
- Previous by thread: Re: sin()/cos()/tan() for kernel code? '_ 'a
- Next by thread: Re: sin()/cos()/tan() for kernel code? '_ 'a
- Index(es):
Relevant Pages
|