001 package atlantis.geometry;
002
003 import atlantis.graphics.ACoord;
004
005
006
007
008
009
010
011 import atlantis.utils.AMath;
012
013
014 public class ATBxDetector extends ABoxDetector {
015
016 double zis;
017 double zos;
018 double ws;
019 double or;
020
021 public ATBxDetector(String name, double zMin, double zMax, double rMin,
022 double rMax, double phi, double excl, double size, double zis, double zos,
023 double ws, double or, int etaIndex, int phiIndex) {
024 super(name, zMin, zMax, rMin, rMax, phi, excl, size, etaIndex, phiIndex);
025 this.zis=zis;
026 this.zos=zos;
027 this.ws=ws;
028 this.or=or;
029 }
030
031 protected ACoord getFZUser() {
032 double[][] hv=new double[2][8];
033 double cosPhi=Math.cos(phi);
034 double sinPhi=Math.sin(phi);
035 double d=size/2.;
036 double r=rMin;
037 double x=r*cosPhi-excl*sinPhi;
038 double y=r*sinPhi+excl*cosPhi;
039 double dsinPhi=d*sinPhi;
040 double dcosPhi=d*cosPhi;
041 double phi1=Math.atan2(y-dcosPhi, x+dsinPhi)*AMath.RADIANS_TO_DEGREES;
042 double phi2=Math.atan2(y+dcosPhi, x-dsinPhi)*AMath.RADIANS_TO_DEGREES;
043
044 if(phi1<0.) phi1+=360.;
045 if(phi2<0.) phi2+=360.;
046 if(phi1-phi2>180.) phi1-=360.;
047 if(phi2-phi1>180.) phi2-=360.;
048 double phiLower=Math.min(phi1, phi2);
049 double phiUpper=Math.max(phi1, phi2);
050 double phiMid=phiLower+ws/size*(phiUpper-phiLower);
051 hv[0][0]=zMin;
052 hv[0][1]=zMin;
053 hv[0][2]=zis;
054 hv[0][3]=zis;
055 hv[0][4]=zos;
056 hv[0][5]=zos;
057 hv[0][6]=zMax;
058 hv[0][7]=zMax;
059 if(or>90.) {
060 phiMid=phiLower+ws/size*(phiUpper-phiLower);
061 hv[1][0]=phiUpper;
062 hv[1][1]=phiMid;
063 hv[1][2]=phiMid;
064 hv[1][3]=phiLower;
065 hv[1][4]=phiLower;
066 hv[1][5]=phiMid;
067 hv[1][6]=phiMid;
068 hv[1][7]=phiUpper;
069 } else {
070 phiMid=phiUpper-ws/size*(phiUpper-phiLower);
071 hv[1][0]=phiLower;
072 hv[1][1]=phiMid;
073 hv[1][2]=phiMid;
074 hv[1][3]=phiUpper;
075 hv[1][4]=phiUpper;
076 hv[1][5]=phiMid;
077 hv[1][6]=phiMid;
078 hv[1][7]=phiLower;
079 }
080
081 return new ACoord(hv);
082 }
083
084 }
Due to the LXR bug, the updates fail sometimes to remove references to deleted files. The Saturday's full rebuilds fix these problems |
This page was automatically generated by the
LXR engine.
|
|