       Re: Trigonometric math functions

• To: mathgroup at smc.vnet.net
• Subject: [mg44572] Re: Trigonometric math functions
• Date: Fri, 14 Nov 2003 04:43:20 -0500 (EST)
• References: <boig47\$og2\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```"Bruno" <bpa at BPASoftware.com> wrote in message news:<boig47\$og2\$1 at smc.vnet.net>...
> Hi all,
>
> I would like to implement an arc cos function on a 16 bits µcontroller
> (optimized sin() and cos() function are welcome).
>
> Does someone have some sources or an algorythm in this way ?
>
>
> Regards.

(Sorry my previous post was a wrong version ! )

In:=(* Why not simply use a series expansion? *)
In:=(s1=Series[ArcCos[x],{x,0,3}]//Normal )//InputForm
Out//InputForm=Pi/2 - x - x^3/6

In:=(s2=Series[Cos[a],{a,0,4}]//Normal)//InputForm
Out//InputForm=1 - a^2/2 + a^4/24

In:=(sol=Solve[x\[Equal]s2,a][] )//InputForm
Out//InputForm={a -> Sqrt*Sqrt[3 - Sqrt*Sqrt[1 + 2*x]]}

In:=lim=x/.FindRoot[s1-a/.sol,{x,0.4}]
Out=0.483528

In:=ClearAll[acos];
acos=Pi/2;
acos=0;
acos[x_ /; 0<x<lim]:=Pi/2-x-x^3/6  ;
acos[x_ /; lim<x<1]:=Sqrt*Sqrt[3-Sqrt*Sqrt[1+2*x]]  ;
acos[x_ /; x<0]:=Pi-acos[-x];
In:=Plot[{ArcCos[x],acos[x]},{x,-1,1}]
no difference can be seen with a naked eye!
---
jcp

```

• Prev by Date: Re: Trigonometric math functions
• Next by Date: Why does Limit sometimes just return what I input?
• Previous by thread: Re: Trigonometric math functions
• Next by thread: Re: Trigonometric math functions