예제 #1
0
  /** Compute circumference by adding up the length of it's segemnts. */
  @Override
  public final void compute() {
    if (!polygon.isDefined()) {
      circum.setUndefined();
      return;
    }

    GeoSegmentND[] segment = polygon.getSegments();
    double length = 0;
    for (int i = 0; i < segment.length; i++) {
      length = length + (segment[i].getLength());
    }
    circum.setValue(length);
  }
예제 #2
0
 @Override
 public final void compute() {
   if (text.isDefined()) length.setValue(text.getTextString().length());
   else length.setUndefined();
 }
예제 #3
0
 // calc length of vector v
 @Override
 public final void compute() {
   dist.setValue(g.distance(h));
 }