} function avgMemb($pts, $memb) { $total = 0; $count = 0; foreach ($pts as $pt) { $total += $pt->$memb; $count++; } return $total / $count; } function center($n) { $pts = array(); for ($i = 0; $i < $n; ++$i) { $p =new Point(); $pts[] = $p; } $center = new Point(); $center->x = avgMemb($pts, 'x'); $center->y = avgMemb($pts, 'y'); $center->z = avgMemb($pts, 'z'); return $center; } for ($i = 1000; $i < 1000000; $i = $i + 1 + ($i / 2)) { $center = center($i); $center->output($i); }
<?php center(4); ?>
pdf_set_info($pdf, "Title", "Analog Clock"); pdf_begin_page($pdf, $width, $height); function center($s, $y, $size, $fontname = "Times-Roman", $outline = 0) { global $pdf, $font, $width; pdf_set_value($pdf, "textrendering", $outline); $font = pdf_findfont($pdf, $fontname, "iso8859-2"); pdf_setfont($pdf, $font, $size); $w = pdf_stringwidth($pdf, $s); pdf_show_xy($pdf, $s, ($width - $w) / 2, $y); } /* outlined */ center("It is {$texttime}.", $height - 60, 42, "Times-Roman", 1); center("It is time for", 200, 100, "Times-Roman", 1); /* filled */ center("Phalanger!", 70, 110, "Times-Bold", 0); pdf_translate($pdf, $radius + $margin, $radius + $margin + $footer); pdf_save($pdf); pdf_setrgbcolor($pdf, 0.0, 0.0, 1.0); /* minute strokes */ pdf_setlinewidth($pdf, 2.0); for ($alpha = 0; $alpha < 360; $alpha += 6) { pdf_rotate($pdf, 6.0); pdf_moveto($pdf, $radius, 0.0); pdf_lineto($pdf, $radius - $ring / 3, 0.0); pdf_stroke($pdf); } pdf_restore($pdf); pdf_save($pdf); /* 5 minute strokes */ pdf_setlinewidth($pdf, 3.0);
</div> <?php } else { if (isset($_GET['category']) && $_GET['category'] != 'Home') { ?> <!--div id="camino"><?php breadcrumbs(); ?> </div--> <?php } } ?> <div id="cont_slides"> <?php center(); ?> <ul id="secciones"> <?php categories(); ?> </ul> </div> <?php } ?> <!--right panel end here --> <div class="clear"></div>
function center_check($text) { // return str_repeat(" ", 22).center($text, 60); // apbw 03/24/05 Wedge printer swap patch return center($text, 60); // apbw 03/24/05 Wedge printer swap patch }
function center_check($text) { return center($text, 60); // apbw 03/24/05 Wedge printer swap patch }