4 package net.sf.openrocket.rocketcomponent;
6 public enum ReferenceType {
10 public double getReferenceLength(Configuration config) {
11 for (RocketComponent c: config) {
12 if (c instanceof SymmetricComponent) {
13 SymmetricComponent s = (SymmetricComponent)c;
14 if (s.getForeRadius() >= 0.0005)
15 return s.getForeRadius() * 2;
16 if (s.getAftRadius() >= 0.0005)
17 return s.getAftRadius() * 2;
20 return Rocket.DEFAULT_REFERENCE_LENGTH;
26 public double getReferenceLength(Configuration config) {
28 for (RocketComponent c: config) {
29 if (c instanceof SymmetricComponent) {
30 SymmetricComponent s = (SymmetricComponent)c;
31 r = Math.max(r, s.getForeRadius());
32 r = Math.max(r, s.getAftRadius());
37 r = Rocket.DEFAULT_REFERENCE_LENGTH;
44 public double getReferenceLength(Configuration config) {
45 return config.getRocket().getCustomReferenceLength();
49 public abstract double getReferenceLength(Configuration rocket);