Avatar

LeAxe Tests (Geodäsie/Vermessung)

MichaeL ⌂, Bad Vilbel, Saturday, 22.08.2009, 16:25 (vor 5360 Tagen) @ philipp

Hallo,

wenn Du, wie angekündigt, tatkräftig helfen willst, wäre es schön, wenn Du besagte Funktion immer gleich anpasst und postest. Man muss ja von Java nicht mehr soviel Ahnung haben aber ein Relationszeichen oder das Prüfen auf Gleichheit wird ja noch drin sein. Ich bin hier als Fachfremder nicht in der Lage, immer alles sofort zu blicken.

Du meinst, es müsse so aussehen (mit Math.abs())?

 
/**
 * Liefert Typ des Achsenelementes
 * @param stationNumber
 * @return keyWord
 */
private int getType(int stationNumber) {
 // letztes Element --> EOP
 if (stationNumber==this.countStations()-1)
  return Axis.EOP; 
 
 AxisStation preStation     = stationNumber > 0?this.getStation(stationNumber-1):null;
 AxisStation behindStation  = stationNumber < this.countStations()-1?this.getStation(stationNumber+1):null;
 AxisStation currentStation = this.getStation(stationNumber);
 
 if ( currentStation.getRadius() == 0 && currentStation.getClothoidParameter() != 0) 
  return Axis.SPIRIN;
 
 else if ( currentStation.getRadius() != 0 && currentStation.getClothoidParameter() == 0) 
  return Axis.CURVE;
 
 else if ( preStation != null && currentStation.getRadius() != 0 && currentStation.getClothoidParameter() != 0 && behindStation.getRadius() == 0)
  return Axis.SPIROUT;
 
 else if ( preStation != null && currentStation.getRadius() != 0 && currentStation.getClothoidParameter() != 0 && preStation.getRadius() !=0 && behindStation.getRadius() !=0 && Math.abs(behindStation.getRadius()) < Math.abs(preStation.getRadius()) ) 
  return Axis.CURVEIN;
 
 else if ( preStation != null && currentStation.getRadius() != 0 && currentStation.getClothoidParameter() != 0 && preStation.getRadius() !=0 && behindStation.getRadius() !=0 && Math.abs(behindStation.getRadius()) > Math.abs(preStation.getRadius()) )  
  return Axis.CURVEOUT;
 
 else //( currentStation.getRadius() == 0 && currentStation.getClothoidParameter() == 0) {
  return Axis.STRAIGHT;
 
} 

Wie ich gerade gesehen habe gibt es den Fall kleiner/größer-gleich nicht. Es werden nur zwei Fälle abgefangen:

 
Math.abs(behindStation.getRadius()) < Math.abs(preStation.getRadius())
// und
Math.abs(behindStation.getRadius()) > Math.abs(preStation.getRadius())
 

Gibt es die?

Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences


gesamter Thread:

 RSS-Feed dieser Diskussion