This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

code for implementing trigonometric calculation

HI Can anyone help me to implement trigonometric function in lpc2148 ?

Thanks

Parents
  • actually

    //*****************************************************/
    // Fast arctan2 software implementation
    //*****************************************************/
    //float SW_atan(float q, float i)
    //{
    //    float angle, abs_q, r;
    //
    //    abs_q = fabs(q) + 1e-10;      // kludge to prevent 0/0 condition
    //    if (i >= 0)
    //    {
    //        r = (i - abs_q) / (i + abs_q);
    //        angle = 0.1963f * r * r * r - 0.9817f * r + 0.7853982f;
    //    }
    //    else
    //    {
    //        r = (i + abs_q) / (abs_q - i);
    //        angle = 0.1963f * r * r * r - 0.9817f * r + 2.3561945f;
    //    }
    //    if (q < 0) angle *= -1;
    //
    //    return angle;
    //}
    //*****************************************************/
    

Reply
  • actually

    //*****************************************************/
    // Fast arctan2 software implementation
    //*****************************************************/
    //float SW_atan(float q, float i)
    //{
    //    float angle, abs_q, r;
    //
    //    abs_q = fabs(q) + 1e-10;      // kludge to prevent 0/0 condition
    //    if (i >= 0)
    //    {
    //        r = (i - abs_q) / (i + abs_q);
    //        angle = 0.1963f * r * r * r - 0.9817f * r + 0.7853982f;
    //    }
    //    else
    //    {
    //        r = (i + abs_q) / (abs_q - i);
    //        angle = 0.1963f * r * r * r - 0.9817f * r + 2.3561945f;
    //    }
    //    if (q < 0) angle *= -1;
    //
    //    return angle;
    //}
    //*****************************************************/
    

Children
No data