To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 1519
1518  |  1520
Subject: 
Re: Math
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Mon, 13 Nov 2000 07:08:01 GMT
Viewed: 
1369 times
  
I sent this before, but it never made it through. My apologies if this
ends up being posted twice.



On Sun, 12 Nov 2000, Michael J Ash wrote:

On Sun, 12 Nov 2000, mike mcfarlane wrote:

Hi
What math functions are available under legOS? I can get the usual +-/ and *
to work, but not powers or square roots. Are these math functions available
and what others e.g. sine, cosine etc?
I thought it would be standard C stuff like pow and sqrt, but they don't
appear to work and I can't find a header file with any math functions in.
Not that I like the stuff or anything ;-)just need to use it.

Most math functions aren't available. They would require so much computing
power, and so few people would use them, that they probably aren't worth
the code space in the kernel. You could probably find some sample
implementations of pow and sqrt floating around and just put them in your
program. Same for trig functions, I guess. I have a library of fixed-point
math routines that includes all trig and inverse-trig functions along with
it. It works great in fixed-point, and could probably be converted to
floating if that's what you're looking for. If you're interested, just let
me know, and I'll be happy to send it along.

Hmm, while we're on the subject, is anybody ELSE interested in a library
of fixed-point math routines? They seem to take up significantly less code
space than the 2k needed for the floating-point routines, and they're
probably faster to boot. I use them all over in my program, and I'd be
more than happy to share.

--
"Say not, 'I have found the truth,' but rather, 'I have found a truth.'
"Say not, 'I have found the path of the soul.' Say rather, 'I have met the
soul walking upon my path.'" -- Khalil Gibran
Mike Ash - <http://www.mikeash.com/>, <mailto:mail@mikeash.com>



1 Message in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR