#include <stdio.h>
#include <stdlib.h>
#include <math.h>

/* gap at the top for left/right etc */
#define NEEDLE_TOP 25;

/* usage: calc_vu width height */
int main(int argc, char *argv[])
{
    int i;

    int x;
    int width = atoi(argv[1]);
    int half_w = width/2;

    float y;
    int height = atoi(argv[2]);
    /* needle height */
    int nh = height - NEEDLE_TOP;

    printf("analog_db_scale\n");
    for (i=1; i <= half_w; i++)
    {
        x = (half_w/2)*log10(i*(100/(float)half_w));

        if (x<0)
            x = 0;

        printf("%d,", x);
    }
    printf("\n\n");

    printf("y_values\n");
    for (i=1; i<=half_w; i++)
    {
        y = sqrt( (pow(nh,2))-(pow((i-(half_w/2)),2)) );
        y = (height - y);
        printf("%d,",(int)y);
    }
    printf("\n\n");



    return 0;
}
