/[libvob]/libvob/org/nongnu/libvob/impl/OrthoCoorder.java
ViewVC logotype

Diff of /libvob/org/nongnu/libvob/impl/OrthoCoorder.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by mudyc, Sat Apr 5 08:56:41 2003 UTC revision 1.6 by mudyc, Sat Apr 5 20:25:10 2003 UTC
# Line 143  public static final String rcsid = "$Id$ Line 143  public static final String rcsid = "$Id$
143      public int buoyOnCircle(int into, int anchor, float cx, float cy, float rad,      public int buoyOnCircle(int into, int anchor, float cx, float cy, float rad,
144                               float px, float py, float min, float max)                               float px, float py, float min, float max)
145      {      {
         pa("buoy..");  
   
146          // check how far from center point anchor is          // check how far from center point anchor is
147          float len = 0;          float len = 0;
148          float [] size = new float[2];          float [] size = new float[2];
# Line 156  public static final String rcsid = "$Id$ Line 154  public static final String rcsid = "$Id$
154          float x = xy[0] + size[0]/2;          float x = xy[0] + size[0]/2;
155          float y = xy[1] + size[1]/2;          float y = xy[1] + size[1]/2;
156    
157          pa("anchor x/y: "+x+"/"+y);          //pa("anchor x/y: "+x+"/"+y);
158    
159          len = (float)Math.sqrt( (x-cx)*(x-cx) + (y-cy)*(y-cy) );          len = (float)Math.sqrt( (x-cx)*(x-cx) + (y-cy)*(y-cy) );
160    
161          pa("len: "+len+", rad: "+rad);          //pa("len: "+len+", rad: "+rad);
162    
163          // if len is longer than rad - do nothing.          // if len is longer than rad - do nothing.
164          float wh = min;          float wh = min;
165          int cs = anchor;          int cs = anchor;
166          if (len <= rad || true) {          if (len <= rad) {
             pa("in buoyCS");  
167    
168              // project and translate buoy              // project and translate buoy
169    
# Line 175  public static final String rcsid = "$Id$ Line 172  public static final String rcsid = "$Id$
172              if (px-x != 0) // tan a = y/x              if (px-x != 0) // tan a = y/x
173                  ac = (py-y)/(px-x);                  ac = (py-y)/(px-x);
174    
             cs = translate(into, (float)Math.cos(ac)*rad/2,  
                            (float)Math.sin(ac)*rad, (len/rad)*100 );  
   
175              //cs = orthoBox(0, (len/rad)*100,cx + (float)Math.cos(ac)*rad/2,              //cs = orthoBox(0, (len/rad)*100,cx + (float)Math.cos(ac)*rad/2,
176              cs = orthoBox(0, 10f,cx + (float)Math.cos(ac)*rad/2,              cs = orthoBox(0, (len/rad)*99f,cx + (float)Math.cos(ac)*rad/2,
177                            cy + (float)Math.sin(ac)*rad, 1,1, 50,50 );                            cy + (float)Math.sin(ac)*rad, 1,1, 50,50 );
178              // box size not counted XXX XXX              // box size not counted XXX XXX
179                            

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26