Switched from 1.6 to 1.5 for more compatibility.
[sw/motorsim] / src / com / billkuker / rocketry / motorsim / CylindricalChamber.java
1 package com.billkuker.rocketry.motorsim;\r
2 \r
3 import javax.measure.quantity.Length;\r
4 import javax.measure.quantity.Pressure;\r
5 import javax.measure.quantity.Volume;\r
6 import javax.measure.unit.SI;\r
7 \r
8 import org.jscience.physics.amount.Amount;\r
9 \r
10 public class CylindricalChamber implements Chamber {\r
11         \r
12         private Amount<Length> length;\r
13         \r
14         private Amount<Length> iD;\r
15 \r
16         public Amount<Pressure> burstPressure() {\r
17                 return null;\r
18         }\r
19 \r
20         public Amount<Volume> chamberVolume() {\r
21                 return iD.divide(2).pow(2).times(Math.PI).times(length).to(SI.CUBIC_METRE);\r
22         }\r
23 \r
24         public Amount<Length> getLength() {\r
25                 return length;\r
26         }\r
27 \r
28         public void setLength(Amount<Length> length) {\r
29                 this.length = length;\r
30         }\r
31 \r
32         public Amount<Length> getID() {\r
33                 return iD;\r
34         }\r
35 \r
36         public void setID(Amount<Length> id) {\r
37                 iD = id;\r
38         }\r
39 \r
40 }\r