Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // To determine tank volume, we start with cylinder volume based on diameter and height
- // Then calculate a sphere of diameter size. This represents the two half domes on top and bottom
- float radius = this.tankComponent.GetFloatProperty("Diameter") / 2.0f;
- float height = this.tankComponent.GetFloatProperty("Height");
- float cylinderVolume = Mathf.PI * radius * radius * height;
- float sphereVolume = 1.33f * Mathf.PI * radius * radius * radius;
- float totalVolume = (cylinderVolume + sphereVolume) * utilization;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement