Jump to content

Search the Community

Showing results for tags 'lissajous slider figure'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. I have a lissajous figure write in PHP but i want to dynamically change a1,a2 T1,T2 value by implementing a slider that when released, posts to the server, updates the values and recreates the image. Can someone help me to do that? Here is a similar example of what I mean http://www.scottlogic.co.uk/blog/colin/2009/06/dependency-property-performance-and-lissajous-figures/ Here is the code: <?php header ("Content-type: image/png"); ///x = a1 * cos(t/T1); /// y = a2 * sin(t/T2); $T1 = 20; $T2 = 30; $myImage = @imagecreatetruecolor(640, 480) or die("Cannot Initialize new GD image stream"); $text_color = imagecolorallocate($myImage, 255, 255, 224); $poly_color = imagecolorallocate($myImage, 124, 120, 224); //calculate x-value and y-value point by point $points = array(); for ($i=0; $i<1000; $i=$i+1) { //define curve's function $x = 310*cos($i/$T1); //define x-value $y = 230*sin($i/$T2);//define y-value //move the coordinate, append a point's x-value and y-value $points[] = 320+$x; //x-value $points[] = 240-$y; //y-value } //count points $totalPoints = count($points)/2; //drawing title $title = "Final Plot ($totalPoints points)"; imagestring($myImage, 3, 5, 5, $title, $text_color); /** drawing points one by one, notice if there * are 10 points, we need to draw 9 lines: * 1) point 0 to 1; * 2) point 1 to 2; * ... * ... * 9) point 8 to 9; */ for ($i=0; $i<$totalPoints-1; $i++) { imageLine($myImage, $points[2*$i], $points[1+2*$i], $points[2+2*$i], $points[3+2*$i], $poly_color); } //finalizing imagepng($myImage); imagedestroy($myImage); ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.