Hi friends .. herewith attached my sketch please help me to solve problem,
its horizontal tank measuring water in liters form.. all dimensions are in cm ..
Result is negative nos and also incorrect..
/*
horizotal tank volume calculation
*/
#include <math.h>
float Level,Watervolume;
const float radius=100;
const float height=25;
int Liters;
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
void loop() {
int Level = (3.14radiusradius)-((radiusradius)acos((radius-height)/radius))+((radius-height)
(sqrt(2radiusheight-(heightheight))));
float Watervolume= (Level*3000);
Serial.print(Watervolume);
Serial.print(" Liters");
Serial.println();
delay (2000);
}