Re: cosine and sin in PHP on Win2K & IIS 5
| From: | Piotr Pluciennik | Date: | Tue, 19 Jun 2001 12:53:08 +0000 |
| Subject: | Re: cosine and sin in PHP on Win2K & IIS 5 | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-7937@lists.php.net to get a copy of this message | ||
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
<bradley@stagghouse.f2s.com> wrote: > 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 for cos() and
> sine().. Some sample code and values follow:
>
> <code>
> print "cos:".cos(270);
> print "sine:".sine(270);
> </code>
> <display>
> cos:0.9843819506325
> sin:-0.17604594647121
> </display>
>
> What's wrong with this picture? Well using my
> trusty scientific
> calculator (from the ol' school days) I get:
> cosine(270) = 0
> sine(270) = -1
>
> Without getting correct values for the sine and
> cosine the rotation
> equations do some really funky stuff =). So what do
> I do now?
>
> Regards
>
> Bradley J Bristow-Stagg
>
/------------------------------------------------------------------------\
>
> \ "Luminous beings are we.. not this crude matter" -
> Yoda /
>
> / "The earth is but ONE country and Mankind it's
> citizens" - Baha'u'llah \
>
>
\------------------------------------------------------------------------/
>
> / www: http://www.staggmatrix.f2s.com | ICQ#:
> 8618833 \
>
>
\------------------------------------------------------------------------/
>
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> php-windows-unsubscribe@lists.php.net
> For additional commands, e-mail:
> php-windows-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>
____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie