Changeset 2442:2750ac386c39 in roaraudio


Ignore:
Timestamp:
08/19/09 23:02:16 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added roar_math_cvpoly()

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • include/libroardsp/poly.h

    r1370 r2442  
    1 //math.h: 
     1//poly.h: 
     2 
     3// was math.h 
    24 
    35/* 
    4  *      Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2008 
     6 *      Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2008, 2009 
    57 * 
    68 *  This file is part of libroar a part of RoarAudio, 
     
    4547int roar_math_mkpoly_5x5 (float * poly, float * data); 
    4648 
     49float roar_math_cvpoly     (float * poly, float t, int len); 
    4750float roar_math_cvpoly_4x4 (float * poly, float t); 
    4851 
  • libroardsp/poly.c

    r1369 r2442  
    105105 
    106106 
     107float roar_math_cvpoly     (float * poly, float t, int len) { 
     108 float ret = 0; 
     109 float ct  = 1; 
     110 int i; 
     111 
     112 if ( poly == NULL ) 
     113  return 0; 
     114 
     115 switch (len) { 
     116  case 4: return roar_math_cvpoly_4x4(poly, t); 
     117 } 
     118 
     119 for (i = 0; i < len; i++) { 
     120  ret += poly[i] * ct; 
     121  ct  *= t; 
     122 } 
     123 
     124 return ret; 
     125} 
     126 
    107127float roar_math_cvpoly_4x4 (float * poly, float t) { 
    108128 float ret = poly[0]; 
Note: See TracChangeset for help on using the changeset viewer.