View unanswered posts | View active topics It is currently Tue Sep 02, 2014 1:11 pm






Reply to topic  [ 3 posts ] 
1.40: code for natural logarithm and e^x exponential funct 
Author Message
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post 1.40: code for natural logarithm and e^x exponential funct
hi,
I'm not sure what RobotC really does or how to do this
(although I strongly hope it's like the standard C commands do...)

what is the correct RobotC code to obtain
- the natural logarithm ln(x) :?:
- the e^x exponential function (2,718..^x) :?:

_________________
regards,
HaWe aka Ford
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;task main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}


Wed Aug 13, 2008 5:07 am
Profile
Creator
Creator

Joined: Fri Feb 09, 2007 9:21 am
Posts: 615
Post Re: 1.40: code for natural logarithm and e^x exponential funct
ROBOTC firmware simply calls the standard C library functions for this with identical parameter.

Read up on these functions in a standard C programming text.


Wed Aug 13, 2008 9:10 am
Profile
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post Re: 1.40: code for natural logarithm and e^x exponential funct
thx,
then everything is fine.
exp(x)=e^x, and log(x) is ln(x)

_________________
regards,
HaWe aka Ford
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;task main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}


Wed Aug 13, 2008 9:24 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.