Skip to content Skip to navigation

OpenStax-CNX

You are here: Home » Content » Sin and Cos using CORDIC

Navigation

Recently Viewed

This feature requires Javascript to be enabled.
 

Sin and Cos using CORDIC

Module by: Luis Moreno. E-mail the author

Summary: Calculation of trigonometrical functions sin and cos , using the CORDIC algorithm

lightgraygray0.5

Contents

  • Look up table
  • Variables de Entrada
  • Iteracion Cero
  • n- Iteraciones
  • Valores Obtenidos
  • Referencias

%Calculation of trigonometrical functions cos(theta) and sen(theta)

%by CORDIC algorithm

n=9; %Number of iterations

Look up table

lutai=[45.00000

       26.56505

       14.03624

        7.12501

        3.57633

        1.78991

        0.89517

        0.44761

        0.22381];

Variables de Entrada

xo=.6072;    % coordenada en X=C

yo=0;        % coordenada en Y=0

zo=45; % Ingrese el angulo en grados

ao=sign(zo); %Comprobacion de Signo

Iteracion Cero

x=xo-yo*ao*(2^-(0));

y=yo+xo*ao*(2^-(0));

z=zo-ao*lutai(1); %Carga de primer valor de angulo

zo=z;  %Actualizar zo

xo=x;  %Actualizar xo

yo=y;  %Actualizar yo

if zo>=0  %Comprobacion de signo

    ai=+1;

 else

    ai=-1;

end

n- Iteraciones

    for i=1:n-1

      x=xo-yo*ai*(2^-(i));

      y=yo+xo*ai*(2^-(i));

      z=zo-ai*lutai(i+1);

      if z>=0  %Comprobacion de signo

         ai=+1;

      else

         ai=-1;

      end

      zo=z;      %actualizar zo

      xo=x;      %actualizar xo

      yo=y;      %actualizar yo

    end

Valores Obtenidos

cosine=x % Coseno

seno1=y  % Seno

lightgray

cosine =

 

    0.7093

 

 

seno1 =

 

    0.7047

 

black

Referencias

- Jack E. Volder The CORDIC Trigonometric Computing Technique IRE Transcactions EC-8, 1959, 330-334

- Amaya Ferney*,Velasco Jaime :Diseño de la tangente inversa usando el algoritmo CORDIC

 *Grupo de Automatica y Robotica, GAR, Universidad Javeriana, Cali, Colombia

 E-mail: foamaya@puj.edu.co, jvelasco@univalle.edu.co\end{verbatim}

 

 

 

\end{document}

 

Content actions

Download module as:

Add module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks