Re: Converting radians to degrees

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: ljb (.)
Date: 03/01/05


Date: Tue, 1 Mar 2005 07:00:25 -0600


"Björn Holmgren" <bjohol@hotmail.com> wrote in message
news:wSVUd.29210$Of5.18983@nntpserver.swip.net...
> "Tarmo Tanilsoo" <tarmo.tanilsoo@mail.ee> wrote in message
> news:4224183f_2@news.estpak.ee...
> > Hello.
> >
> > How I can convert radians to degrees in VBScript? I need to get sine of
> the
> > degree, but I get sine of the radian.
> >
> > With best wishes,
> >
> > Tarmo Tanilsoo
> >
> >
>
> Const PI = 3.14159265358979
>
> Function Dgr2Rad(Degrees)
> Dgr2Rad = Degrees * (2 * PI) / 360
> End Function
>
> Function Rad2Dgr(Radians)
> Rad2Dgr = Radians * 360 / (2 * PI)
> End Function
>
>
> --
> Björn Holmgren
>

Rather than a constant for PI and not knowing if 2, 3 or 10 decimal places
are good enough, I use:

pi = 4.0 * Atn(1)

Its precision is as good as the machine that it is running on.



Relevant Pages

  • Re: Sine code for ANSI C
    ... >> compute the sine of small arguments quickly, but if it has to take ... > angle is greater than pi. ... All the library writer knows is that there's little *precision* ... small arguments it radians are easy to compute. ...
    (comp.lang.c)
  • Re: A tough question about elementary mathematics
    ... In truth, we don't even need "radians" for this, and I would argue (as ... number is 0 then the sine is 0 if the real number is equal to pi/2 the ... anything measured in radians is dimensionless. ... I know that radians are used in calculus ...
    (sci.math)
  • Re: Binary degrees?
    ... No. Radians are the natural units for trig functions. ... The Taylor expressions for sine and cosine are in terms of angles expressed ...
    (sci.math)
  • Re: A tough question about elementary mathematics
    ... In truth, we don't even need "radians" for this, and I would argue (as ... unit circle in the appropriate direction, arrives at a point on ... point that I was unable to articulate, that a real number goes into the sine ... Angles measured in radians ...
    (sci.math)
  • Re: Converting radians to degrees
    ... "Tarmo Tanilsoo" wrote in message ... > How I can convert radians to degrees in VBScript? ... but I get sine of the radian. ...
    (microsoft.public.scripting.vbscript)