Recent

Author Topic: Strange value of Cos 90º  (Read 6026 times)

BlueIcaro

  • Hero Member
  • *****
  • Posts: 818
    • Blog personal
Strange value of Cos 90º
« on: April 07, 2011, 07:42:19 pm »
Hello, Cos of 90º (degress) is 0.

But If I code this:

Code: Pascal  [Select][+][-]
  1. C := Cos (gradtorad (90));
  2.  

C isn't 0, it's 0.1564....

My Lazarus is 0.9.30 "Oficial" Release.

it's a bug?, Did I samething wrong?

/BlueIcaro

Arbee

  • Full Member
  • ***
  • Posts: 223
Re: Strange value of Cos 90º
« Reply #1 on: April 07, 2011, 07:53:14 pm »
I think you need to use DegToRad in stead of GradToRad
1.0/2.6.0  XP SP3 & OS X 10.6.8

BlueIcaro

  • Hero Member
  • *****
  • Posts: 818
    • Blog personal
Re: Strange value of Cos 90º
« Reply #2 on: April 07, 2011, 08:03:01 pm »
Ups!!, it's true  :-[
Thank you
/BlueIcaro

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12142
  • FPC developer.
Re: Strange value of Cos 90º
« Reply #3 on: April 08, 2011, 11:08:25 am »
(iirc grad has 400 degrees in a circle)

 

TinyPortal © 2005-2018