Go to Post Engineering still can't beat Physics! - Manoel [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 25-10-2004, 20:15
cibressus53's Avatar
cibressus53 cibressus53 is offline
Registered User
#1397
 
Join Date: Oct 2004
Location: ajax
Posts: 14
cibressus53 is on a distinguished road
Trigometric Functions

are there any libraries for mlab and control unit for trigometric functions?
__________________
EMAIL: TERRYnospamP AHT MELDSTARspammenot DAWT COM
  #2   Spotlight this post!  
Unread 25-10-2004, 20:19
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,186
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Re: Trigometric Functions

http://www.chiefdelphi.com/forums/sh...ad.php?t=26644

that might help you
  #3   Spotlight this post!  
Unread 25-10-2004, 20:27
Rickertsen2 Rickertsen2 is offline
Umm Errr...
None #1139 (Chamblee Gear Grinders)
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2002
Location: ATL
Posts: 1,421
Rickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant future
Send a message via AIM to Rickertsen2 Send a message via Yahoo to Rickertsen2
Re: Trigometric Functions

Quote:
Originally Posted by cibressus53
are there any libraries for mlab and control unit for trigometric functions?
Nope. Write your own. Since calculating a Taylor/McLauren series or whatever on the fly with the PIC isn't exactly practical there are several approaches

1.) Precomputed lookup tables. Fast to read from but eat alot of program space. If you are cramped for program space you can reduce the number of points in the table and use linear interpolation.

2.) CORDIC algorith. I'm lazy. Google it

3.)Parabolic approximation. a halfsin function can be approximated reasonably well using a parabola. All other trig functions can be derived from halfsine. This goes for lookup tables too. You only need to store half of a sin cycle

4.) calculatea series on the fly. We actually tested this and it worked reasonable well if you precomputer the factorials. I wouldn't recommend it though. It is rather slow compared to the other approaches. We did it more to show that it could be done.

There are a few old threads on forums that discuss this topic. Again I'm lazy. Search for them yourself
__________________
1139 Alumni
  #4   Spotlight this post!  
Unread 25-10-2004, 21:03
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,567
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Trigometric Functions

Quote:
Originally Posted by Rickertsen2
Nope. Write your own.
Yes there are: http://www.chiefdelphi.com/forums/sh...threadid=26644
  #5   Spotlight this post!  
Unread 25-10-2004, 21:49
Anthony Kesich's Avatar
Anthony Kesich Anthony Kesich is offline
Programmer Turned Engineer
AKA: SonKenshin
#1097 (Site 3 Engineernig)
Team Role: Leadership
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Sacramento, CA
Posts: 186
Anthony Kesich has a spectacular aura aboutAnthony Kesich has a spectacular aura about
Send a message via AIM to Anthony Kesich
Re: Trigometric Functions

Quote:
Originally Posted by Rickertsen2
Nope. Write your own. Since calculating a Taylor/McLauren series or whatever on the fly with the PIC isn't exactly practical there are several approaches
Even though using the taylor/McLauren Series is not that fast on a PIC, you are going to have enough power and time to run the standard C-library math functions unless you are doing a tremendous amount of processing and using all your interruputs. That and using the Math library is quick and easy. Granted, if you want to, you can use the above mentioned methoda, it just takes some work to set up. It may have just been my team, but we didn't have any problem with lack of processing power last year.
__________________
C is screwing up my English--I'm ending all my sentences in semi-colons;

Horray for most things! -George Carlin

"Sure, I'll play rugby. Besides, I have a lot of experience running from really big guys who want to cream me." -Me, Freshman year
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Do you write functions for your code? Max Lobovsky Programming 26 11-03-2004 07:04
Important functions of a first robot? Ianworld General Forum 5 15-04-2003 13:29
Primary Functions Poll Ben Mitchell Rules/Strategy 1 16-02-2003 02:10
What? Isnt everyone building new functions on their robot?? archiver 2001 4 24-06-2002 01:34
Return of the Inverse Trig Functions Leo M Programming 3 24-01-2002 08:12


All times are GMT -5. The time now is 02:52.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi