Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
"; $im = imagecreatefrompng("1.png"); $Pi = pi(); $centerX = $width / 2; $centerY = $height / 2; echo "
The picture here is " . $width . " wide, and " . $height . " tall.
"; echo "
The center of the image is at " .$centerX . ", " . $centerY ; echo '
Test Trig Fucntions php
Get all cordinates for a circle
'; //$r = 1 ; $sum = 0; //echo 'Radiuz == ' . $r . '
X, Y, PixelColour at that point.
'; //Max radius if ($centerX < $centerY){ $maxRad = $centerX - 1; } elseif ($centerY <= $centerX){ $maxRad = $centerY -1; } echo "Maximumux Radius is: " . $maxRad . "
Ring Number, Average Value:
"; for($r=1; $r<=$maxRad; $r++ ){ for ($a=0; $a<=360; $a++) { $ax = $r*cos($a*$Pi/180) + $centerX ; //x $ay = $r*sin($a*$Pi/180) + $centerY ; //y $PXCol = imagecolorat($im, $ax, $ay); //outputs a decimal number for color // echo $ax . ", " . $ay . ", " . $PXCol . "
"; $sum = $sum + $PXCol; $avg = $sum / 360; $trunc = round($avg); } echo $r . ", " . dechex($trunc) . "
"; } // choose a color for the ellipse $ellipseColor = imagecolorallocate($im, 0, 0, 255); // draw the white ellipse imagefilledellipse($im, $centerX, $centerY, 300, 300, $ellipseColor); // Output the image. //header("Content-type: image/png"); //imagepng($im); //echo "
Trucated Average: ".$trunc."
"; //echo "
Average in Hex: ". dechex($trunc) ."
"; ?>
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)