Hi,
your problem is probably because php expects your angle to be expressed in
radians and you are expressing it in degrees... To covert you can use these
equations:
degrees=radians*(180/PI)
radians=degrees*(PI/180)
hth,
Kelvin.
-Original Message-
From: Bradley J Bristow-Stagg [mailto:[
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 in a little
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]
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
[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
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:
>