Tank Truck
Last updated
Was this helpful?
Last updated
Was this helpful?
calculate area of circle (PI * r **2)
calculate height of cylinder (volume of cylinder / area of circle (process-1)
calculate area of triangle of sector
| radius - h | = height of a triangle (must calculate absolute value)
radius is adjacent of triangle
calculate sector 2 triangle(process-3) = 1 sector
calculate theta angle of sector
calculate theta use process-3 theta angle(degree) = arcsin ( sin theta ) * (180/PI) sector theta = theta angle * 2
calculate segment which means volume of tank
segment = sector - sector triangle
= sector(process-4) - triangle(process-3*2)
if h (height of liquid) greater than radius (which means it's bigger than half) return (volume of cylinder - process-6)
if h (height of liquid) less than radius return process-6