I’m trying to measure a volume of water in my water tank using ultrasonic sensor. The sensor gives me water level in the tank but as the tank is cylindrical I need to re-calculate this to the water volume in order to know how much water is in there. For that, I need to use the cos() function. I’ve tried to use an expression with cos() or Math.cos() but without success.

Would anyone have an idea how to tweak Pimatic to work with cos() function?

Thanks a lot in advance!

]]>I’m trying to measure a volume of water in my water tank using ultrasonic sensor. The sensor gives me water level in the tank but as the tank is cylindrical I need to re-calculate this to the water volume in order to know how much water is in there. For that, I need to use the cos() function. I’ve tried to use an expression with cos() or Math.cos() but without success.

Would anyone have an idea how to tweak Pimatic to work with cos() function?

Thanks a lot in advance!

]]>`Math.acos()`

what you need for the given calc?
`Volume = L * (Math.pow(R, 2) * Math.acos((R - D)/ R) - (R - D) * Math.sqrt(2 * R * D - Math.pow(D, 2)))`

]]>Thanks

]]>`$L * (pow($R) * acos(($R - $D) / $R) - ($R - $D) * sqrt(2 * $R * $D - pow($D)))`

]]>Thank you!

]]>pimatic@0.9.41 including the required functions has bee released

]]>