Advertisement
j0h

Trigory

j0h
Sep 18th, 2014
434
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.66 KB | None | 0 0
  1. <?php
  2. list($width, $height, $type, $attr) = getimagesize("spc.jpg");
  3. echo "<img src=\"spc.jpg\" $attr alt=\"getimagesize() example\" />";
  4.  
  5. $cntrX = $width / 2;
  6. $cntrY = $height / 2;
  7. echo "<br>The center of the image is at " .$cntrX . ", " . $cntrY ;
  8. echo '<br>Test Trig Fucntions php <br> Get all cordinates for a circle<br>';
  9. $r = 5 ;
  10. echo 'Radiuz == ' . $r . '<br> X, Y, PixelColour at that point.<br><br>';
  11.  
  12. $im = imagecreatefromjpeg("spc.jpg");
  13. $Pi = pi();
  14. for ($a=0; $a<=360; $a++) {
  15.  
  16.    $ax =  $r*cos($a*$Pi/180) ; //x
  17.    $ay =  $r*sin($a*$Pi/180) ; //y
  18.    $PXCol = imagecolorat($im, $ax, $ay);
  19.    echo $ax . ", " . $ay . ", " . $PXCol . "<br>";
  20. }
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement