Desenho da função cosseno

String barra = "************************************************************************************";

void setup() {

  Serial.begin(9600);

  Serial.println("HISTOGRAMA: ");

  float pi=3.1416;

  for (int i=1; i<30; i++)

    Serial.println( barra.substring(0, cos(2*pi/30*i) *30 + 31  ));

}

void loop() {

}