/Users/lyon/j4p/src/sound/filterDesign/Root.java

1    package sound.filterDesign; 
2     
3    // Decompiled by Jad v1.5.8c. Copyright 2001 Pavel Kouznetsov. 
4    // Jad home page: http://www.geocities.com/kpdus/jad.html 
5    // Decompiler options: packimports(3)  
6    // Source File Name:   Root.java 
7     
8    import java.awt.*; 
9    import java.io.Serializable; 
10    
11   public abstract class Root 
12           implements Serializable { 
13    
14       public Root() { 
15           real = 0.0D; 
16           imag = 0.0D; 
17       } 
18    
19       public Root(double d, double d1) { 
20           real = d; 
21           imag = d1; 
22       } 
23    
24       public Root(Root root) { 
25           real = root.real; 
26           imag = root.imag; 
27       } 
28    
29       public double getReal() { 
30           return real; 
31       } 
32    
33       public double getImag() { 
34           return imag; 
35       } 
36    
37       public void setReal(double d) { 
38           real = d; 
39       } 
40    
41       public void setImag(double d) { 
42           imag = d; 
43       } 
44    
45       public void setPos(double d, double d1) { 
46           real = d; 
47           imag = d1; 
48       } 
49    
50       public double absWrtOmega(double d) { 
51           double d1 = real * real + (d - imag) * (d - imag); 
52           return d1; 
53       } 
54    
55       public double at(double d, double d1) { 
56           double d2 = (d - real) * (d - real) + (d1 - imag) * (d1 - imag); 
57           return d2; 
58       } 
59    
60       public double angleWrtOmega(double d) { 
61           double d1 = Math.atan((d - imag) / -real); 
62           return d1; 
63       } 
64    
65       public double angleWrtOmega2(double d) { 
66           double d1 = Math.atan2(d - imag, -real); 
67           return d1; 
68       } 
69    
70       public abstract void draw(Graphics g, 
71                                 double d, 
72                                 double d1, 
73                                 int i, 
74                                 int j); 
75    
76       public boolean inRoot(double d, double d1, int i, int j, int k, 
77                             int l) { 
78           int i1 = (int) Math.rint( 
79                   (getReal() * (double) i) / (2D * d) + (double) (i / 2)); 
80           int j1 = (int) Math.rint( 
81                   (-getImag() * (double) j) / (2D * d1) + (double) (j / 2)); 
82           return Math.abs(k - i1) < 10 && 
83                   (Math.abs(l - j1) < 10 || Math.abs(j - l - j1) < 10); 
84       } 
85    
86       public abstract String toString(); 
87    
88       protected double real; 
89       protected double imag; 
90   } 
91