RE: [PHP-WIN] cosine and sin in PHP on Win2K & IIS 5

2001-06-19 Thread Kelvin Luck
:[EMAIL PROTECTED]] Sent: 19 June 2001 06:16 To: [EMAIL PROTECTED] Subject: [PHP-WIN] cosine and sin in PHP on Win2K & IIS 5 Hey guys, I am currently dabbling in a little graphics generation with gd_lib in PHP on my Win2K box with IIS 5. Up until now I have had ZERO problems and am really lo

RE: [PHP-WIN] cosine and sin in PHP on Win2K & IIS 5

2001-06-19 Thread Gu Weidong-a1923c
Use cos(270/360*2*pi()) instead of cos(270). -Original Message- From: Bradley J Bristow-Stagg [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 19, 2001 1:16 PM To: [EMAIL PROTECTED] Subject: [PHP-WIN] cosine and sin in PHP on Win2K & IIS 5 Hey guys, I am currently dabbling

Re: [PHP-WIN] cosine and sin in PHP on Win2K & IIS 5

2001-06-19 Thread Phil Driscoll
PHP, like every other programming language I have ever come across, uses radians for its trig functions. you need 3*pi/2 for 270 degrees see deg2rad and rad2deg in the manual. Cheers -- Phil Driscoll -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED]

Re: [PHP-WIN] cosine and sin in PHP on Win2K & IIS 5

2001-06-19 Thread Piotr Pluciennik
Hi, use arguments of trigonometric functions in radians, not degrees. Everything is ok in your example. Put as an argument for example pi/2... it will work. Greetings Piotr --- Bradley J Bristow-Stagg <[EMAIL PROTECTED]> wrote: > Hey guys, > I am currently dabbling in a little graphics > ge

Re: [PHP-WIN] cosine and sin in PHP on Win2K & IIS 5

2001-06-19 Thread Bradley J Bristow-Stagg
[EMAIL PROTECTED] (Johan Lundqvist) wrote in news:3B2F0C33.5AE1B074 @noatun.org: > deg2rad(270); > Thanks Johann, that worked a treat =) Regards Bradley J Bristow-Stagg -- /\ \ "Luminous beings are we.. not this crude ma

Re: [PHP-WIN] cosine and sin in PHP on Win2K & IIS 5

2001-06-19 Thread Johan Lundqvist
Hi, That's correct, since PHP cos() and sin() uses radians and not degrees. This can be solved by first using deg2rad(). This would make your code look like this: $i = deg2rad(270); print "cos:".cos($i); print "sine:".sin($i); cos:0 sin:-1 /Johan Bradley J Bristow-Stagg wrote: >

[PHP-WIN] cosine and sin in PHP on Win2K & IIS 5

2001-06-19 Thread Bradley J Bristow-Stagg
Hey guys, I am currently dabbling in a little graphics generation with gd_lib in PHP on my Win2K box with IIS 5. Up until now I have had ZERO problems and am really loving working with PHP. My problem then? Well I am rotating a polygon around a point and PHP is not giving me correct values fo