[PHP] Draw function diagram

2007-06-05 Thread Khorosh Irani

Hello
I have a function like (y(x)=sin(x)) that i convert it to post fix and then
execute it.means that i coud get y for each x value
now I have a simple question
I want to draw diagram of function.
how I should do this
I dont work with gd and also i donot now how I should done this.but i think
that i should get a range for x and get y for each x but i dont know how I
shold draw diagram after this
Thanks
Excuse me for my bad english


Re: [PHP] Draw function diagram

2007-06-05 Thread Khorosh Irani

Hi
I worked alittle with gd
It is my code for y(x)=sin(x)+cos(x):

   function Graph($rangeLow, $rangeHigh, $step)
   {
   $img = ImageCreate($this-width, $this-height);
   $background_color = imagecolorallocate($img, 0, 0, 0);
   $white = ImageColorAllocate($img, 255, 255, 255);
   imageline($img, $this-width/2, 0,$this-width/2 , $this-height,
$white);
   imageline($img, 0, $this-height/2, $this-width, $this-height/2,
$white);
   for ($x=rangeLow;$x=$rangeHigh,$x+=$step)
   {
y=sin(x)*cos(x);//custom function
//i dont know what should write here but i know that I should
write imageline() function
}
   header(Content-type: image/jpeg);
   ImageJpeg($img);
   imagedestroy($img);
   }


could anyone write a simple code that complete this code
I want to learn it
I dont want to use any software package
Thanks


On 6/6/07, Richard Lynch [EMAIL PROTECTED] wrote:


On Tue, June 5, 2007 4:36 pm, Khorosh Irani wrote:
 Hello
 I have a function like (y(x)=sin(x)) that i convert it to post fix and
 then
 execute it.means that i coud get y for each x value
 now I have a simple question
 I want to draw diagram of function.
 how I should do this
 I dont work with gd and also i donot now how I should done this.but i
 think
 that i should get a range for x and get y for each x but i dont know
 how I
 shold draw diagram after this

Start working with GD would be my first answer...

If you can't use GD, then I would guess that somewhere out there
there may exist a software package that you can pass sin(x) to it,
and it will create a graph for you...  No idea what it's called,
though...

--
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?




[PHP] Power

2006-01-08 Thread Khorosh Irani
Hello
How I can get the power of an integer number (for example 8 power 2=64) only
with loops (without pow() function)?
Thanks


[PHP] Language check

2005-11-28 Thread Khorosh Irani
Hello
I want to sure that all the character of a posted string is in my
language(persian for example).What should I do?
Thanks


[PHP] Compile a stored code with php

2005-11-19 Thread Khorosh Irani
Hello
How I can compile a php code that is stored in a database when the programm
is running?
Thanks


[PHP] Classes or functions

2005-10-19 Thread Khorosh Irani
What this methods are better for php4? classes or functions
Does it better to use classes whennbsp;I can write the codes with
functions?
Excuseme for my bad english


[PHP] Classes or functions

2005-10-19 Thread Khorosh Irani
What this methods are better for php4? classes or functions
Does it better to use classes when I can write the codes with functions?
Excuseme for my bad english


[PHP] flashPHP Issue

2005-05-09 Thread Khorosh Irani
Hello
Can I get the background color a swf file with php?
Thanks

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] OO toturial

2005-05-05 Thread Khorosh Irani
hello
Can anyone tell me the url of a good toturial about object and php that contain:
polymorphism,Delegation,...?
Thanks

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] FlashPHP Issue

2005-05-05 Thread Khorosh Irani
Hello
How I can get the width and height of a swf file with php?
Thanks

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Regular expressions problem

2005-04-30 Thread Khorosh Irani
For example I want to math this stream:
123 mm  334
What is the pattern that math with this stream?
Thanks

On 4/29/05, Malcolm Mill [EMAIL PROTECTED] wrote:
 What is it you want to do?
 
 On 4/29/05, Khorosh Irani [EMAIL PROTECTED] wrote:
  Hello
  I have a question:
  What is in the role of space in the regular expressions (POSIX)?
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Regular expressions problem

2005-04-29 Thread Khorosh Irani
Hello
I have a question:
What is in the role of space in the regular expressions (POSIX)?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Some Question

2005-04-26 Thread Khorosh Irani
Hello I have some questions:
1.How I can make a optional argument in function that if I dont
mention it in my code does not make problem?
2.How I can see apache or IIS headers?
Thanks

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Some Question

2005-04-26 Thread Khorosh Irani
Hello
1.I dont have this mean I want this:
for example I write this function :myfunction ($para1, $para2,
$para3=123) .And I want to make $para1 optional that If I didnt write
it (for example:myfunction(1,123) )
It does not make problem
2.I want to see all of header not HTTP_USER_AGENT?
Thanks
On 4/26/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 I'm no authority, but I'm going to have a punt at this one
 
  1.How I can make a optional argument in function that if I dont
  mention it in my code does not make problem?
 
 You can pass fewer arguments than specified in a function, so just
 make the optional ones to the right of the required ones. Also if you,
 say myfunction ($para1, $para2, $para3=123) it makes $para3 hold a
 default value if nothing's passed
 
  2.How I can see apache or IIS headers?
 
 Look for $HTTP_ followed by the header name in upper case and with any
 -s replaced by _, eg. HTTP_USER_AGENT
 
 hth
 J


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] A question

2005-04-16 Thread Khorosh Irani
Hello
How I can find that php is installed as cgi or as apache module?
Thanks

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: A question

2005-04-16 Thread Khorosh Irani
How I can find it in phpinfo() ?

On 4/16/05, Amir Mohammad Saied [EMAIL PROTECTED] wrote:
 phpinfo()
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php