Go to Post New CAD computer one day and the 254 Build Blog Tech Binder the next? Christmas in July really does exist. - [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 14-02-2007, 11:20
Tottanka's Avatar
Tottanka Tottanka is offline
It isnt about bots,its about humans
AKA: Liron Gurvitz
FRC #3211 (The Y Team)
Team Role: Mentor
 
Join Date: Dec 2006
Rookie Year: 2006
Location: Hadera, Israel
Posts: 1,418
Tottanka has a reputation beyond reputeTottanka has a reputation beyond reputeTottanka has a reputation beyond reputeTottanka has a reputation beyond reputeTottanka has a reputation beyond reputeTottanka has a reputation beyond reputeTottanka has a reputation beyond reputeTottanka has a reputation beyond reputeTottanka has a reputation beyond reputeTottanka has a reputation beyond reputeTottanka has a reputation beyond repute
HELP: How do i make Arcsin in MPLAB

Hey
An important question for our team:
How do i make arcsin in MPlab, not using a 1 to 180 loop checking every angle and finding the closest one to the value i need?

thanks, the Black Knights
__________________
My FRC record: 10 Years,FTA (2008-9), 3 Teams(1947,2669,3211).3 RCA, 1 Championship EI(2016), 1 Divisional finalist (2016), 1 Regional winner.
Israeli 2016 Volunteer of the year.
  #2   Spotlight this post!  
Unread 14-02-2007, 11:57
Shinigami2057 Shinigami2057 is offline
Slackware Is Your New God (Mentor)
AKA: Harry Bock
FRC #1350 (Rambots)
Team Role: Programmer
 
Join Date: Oct 2006
Rookie Year: 2006
Location: Johnston, RI
Posts: 106
Shinigami2057 is just really niceShinigami2057 is just really niceShinigami2057 is just really niceShinigami2057 is just really niceShinigami2057 is just really nice
Re: HELP: How do i make Arcsin in MPLAB

Should be in <math.h>.

Code:
#include <math.h>

double asin(double x);
float asinf(float x);
__________________
One of the main causes of the fall of the Roman Empire was that, lacking zero, they had no way to indicate successful termination of their C programs.
  #3   Spotlight this post!  
Unread 14-02-2007, 12:18
efoote868 efoote868 is offline
foote stepped in
AKA: E. Foote
FRC #0868
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2005
Location: Noblesville, IN
Posts: 1,420
efoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond repute
Re: HELP: How do i make Arcsin in MPLAB

you could make a lookup table... a large array usually can do the trick. It'll save you the processing power from not using a double, but it'll eat up memory pretty quickly.
__________________
Be Healthy. Never Stop Learning. Say It Like It Is. Own It.

Like our values? Flexware Innovation is looking for Automation Engineers. Check us out!
  #4   Spotlight this post!  
Unread 14-02-2007, 12:28
Guy Davidson Guy Davidson is offline
Registered User
AKA: formerly sumadin
FRC #0008 (Paly Robotics)
Team Role: Alumni
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Ra'anana, Israel
Posts: 660
Guy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to behold
Send a message via ICQ to Guy Davidson Send a message via AIM to Guy Davidson Send a message via MSN to Guy Davidson
Re: HELP: How do i make Arcsin in MPLAB

I would try and google arcsin approximation and find one that only involves rational expressions, to limit the amount of floating point math.
  #5   Spotlight this post!  
Unread 14-02-2007, 17:48
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,078
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: HELP: How do i make Arcsin in MPLAB

There was a whitepaper on Delphi a couple years ago about CORDIC trig implementations...you should look it up.
  #6   Spotlight this post!  
Unread 15-02-2007, 15:22
Cheezmeister Cheezmeister is offline
Registered User
FRC #0871
 
Join Date: Jan 2007
Location: Long Island
Posts: 8
Cheezmeister is an unknown quantity at this point
Re: HELP: How do i make Arcsin in MPLAB

Quote:
Originally Posted by Shinigami2057 View Post
Should be in <math.h>.

Code:
#include <math.h>

double asin(double x);
float asinf(float x);
You don't know how long we were pulling our hair out last year because it couldn't parse "arcsin(x)" (not to mention me repeatedly telling others that "1/sin(x)" would NOT do it) ;D
  #7   Spotlight this post!  
Unread 15-02-2007, 15:33
aaeamdar's Avatar
aaeamdar aaeamdar is offline
Post-A-Holic
AKA: Paul Dennis
FRC #1719 (The Umbrella Corp)
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Baltimore, MD
Posts: 231
aaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant future
Re: HELP: How do i make Arcsin in MPLAB

Quote:
Originally Posted by Cheezmeister View Post
You don't know how long we were pulling our hair out last year because it couldn't parse "arcsin(x)" (not to mention me repeatedly telling others that "1/sin(x)" would NOT do it) ;D
This is humerous, but likely the result of what I am informed is another case of poor american practice (or practise). arcsin is usually written sin^(-1), and this can cause confusions, since x^(-1) would in fact equal 1/x. However, in the case of sin^(-1) (and other inverse trig operations), it just means arcsin.

I could be wrong about the fact that it's american in origin, but I imagine that's the root of your problem.

Paul
  #8   Spotlight this post!  
Unread 15-02-2007, 15:39
fallen751 fallen751 is offline
Registered User
FRC #2052
 
Join Date: Jan 2007
Location: Minnesota
Posts: 17
fallen751 is an unknown quantity at this point
Re: HELP: How do i make Arcsin in MPLAB

If your range of data is within a pretty reasonable small area like (0, pi/2) you could try doing a fifth or sixth degree taylor polynominal instead - it might help with the processing power. then again, if your not performing many other calculations the arctanx function should work fine. (remember it returns radians.)
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
MPLAB 7.20 Help please? groovy69 Programming 14 22-01-2007 02:00
Help with MPLAB burningpig Programming 9 17-01-2007 13:10
Help how to make a forum was217now1509 Website Design/Showcase 12 25-02-2005 22:37
MPLAB IDE HELP Idaman323 Programming 2 16-02-2005 18:01
Arcsin Calculation Algorithm Leo M Technical Discussion 11 05-11-2001 08:31


All times are GMT -5. The time now is 00:31.

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