degrees not radians

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jeff Thies

    #1

    degrees not radians

    Is it possible to set the Math functions to use degrees instead of
    radians?

    I'm working out some astronomical calculations and everything is in
    degrees. All those conversions are driving me a bit crazy!

    Jeff


  • Christopher Jeris

    #2
    Re: degrees not radians

    "Jeff Thies" <nospam@nospam. net> writes:[color=blue]
    > Is it possible to set the Math functions to use degrees instead of
    > radians?
    > I'm working out some astronomical calculations and everything is in
    > degrees. All those conversions are driving me a bit crazy![/color]

    Nope.

    Do your conversion only at input and output, and store all your
    intermediate results in radian measure.

    You could define some helper functions. Note that I don't know
    whether I've committed any sins of floating-point-misuse here.

    // m is an angle measure in degrees
    function radians(m) { return m * Math.PI / 180.0; }

    // m is an angle measure in radians
    function degrees(m) { return m * 180.0 / Math.PI; }

    Then if you were really desperate you could define your own
    variant functions:

    // m is an angle measure in degrees
    define cosD(m) { return Math.cos(radian s(m)); }

    but it is not a good idea to be constantly converting and back-
    converting. Like I said, convert only at input and output.

    --
    Chris Jeris cjeris@oinvzer. net Apply (1 6 2 4)(3 7) to domain to reply.

    Comment

    • Jeff Thies

      #3
      Re: degrees not radians

      > Then if you were really desperate you could define your own[color=blue]
      > variant functions:
      >
      > // m is an angle measure in degrees
      > define cosD(m) { return Math.cos(radian s(m)); }[/color]

      I like that idea but can't get it to work. I'm getting an error:

      missing ; before statement. (after the define)
      [color=blue]
      >
      > but it is not a good idea to be constantly converting and back-
      > converting. Like I said, convert only at input and output.[/color]

      I wish! I'm not smart enough to do that! Ever look at the calculations for
      the Moon's position? It's nothing I feel like tinkering with!

      Cheers,
      Jeff
      [color=blue]
      >
      > --
      > Chris Jeris cjeris@oinvzer. net Apply (1 6 2 4)(3 7) to domain to reply.[/color]


      Comment

      • Christopher Jeris

        #4
        Re: degrees not radians

        "Jeff Thies" <nospam@nospam. net> writes:[color=blue][color=green]
        > > // m is an angle measure in degrees
        > > define cosD(m) { return Math.cos(radian s(m)); }[/color]
        > I like that idea but can't get it to work. I'm getting an error:
        > missing ; before statement. (after the define)[/color]

        This was me having a Scheme braino. Replace 'define' by 'function'.

        --
        Chris Jeris cjeris@oinvzer. net Apply (1 6 2 4)(3 7) to domain to reply.

        Comment

        • Dr John Stockton

          #5
          Re: degrees not radians

          JRS: In article <uy8tahu9p.fsf@ oinvzer.net>, seen in
          news:comp.lang. javascript, Christopher Jeris <cjeris@oinvzer .net> posted
          at Thu, 18 Dec 2003 13:10:10 :-
          [color=blue]
          >You could define some helper functions. Note that I don't know
          >whether I've committed any sins of floating-point-misuse here.
          >
          >// m is an angle measure in degrees
          >function radians(m) { return m * Math.PI / 180.0; }[/color]
          [color=blue]
          > ...[/color]

          Looks OK. If called a lot, it ***might*** be a little faster to do a
          global var Pi = Math.PI and then use that. If, as is possible, 90
          degrees is used a lot, then Pi2 = Pi/2 for a further small gain.

          --
          © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
          <URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang. javascript
          <URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
          <URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.

          Comment

          • Richard Cornford

            #6
            Re: degrees not radians

            "Jeff Thies" <nospam@nospam. net> wrote in message
            news:XAlEb.3790 $wL6.615@newsre ad1.news.atl.ea rthlink.net...[color=blue]
            > Is it possible to set the Math functions to use
            >degrees instead of radians?[/color]
            <snip>

            No.

            But, depending on what you are doing you could still work in degrees. If
            you were interested in say sine and cosine values in increments of whole
            degrees you could create your own look-up tables:-

            var sinTable = [];
            var cosTable = [];
            var degToRads = Math.PI/180;
            for(var c = 0;c < 360;c++){
            sinTable[c] = Math.sin(c*degT oRads);
            cosTable[c] = Math.cos(c*degT oRads);
            }

            var sinOf_23 = sinTable[23];

            - but that only really works if you can get away with only using whole
            degree steps. It could be expanded to say quarter degree steps but then
            the work of converting a floating-point value into an integer Array
            index (multiplying by 4 and rounding/flooring) would be similar to the
            work required to convert degrees to radians.

            I suppose the next option would be to create an object that had similar
            functions to the Math object that wrapped calls to the real Math object
            methods in code that did the degree to radians conversion for you:-

            var degreeMath = (function(){
            var m = Math;
            var degToRads = (m.PI/180);
            return ({
            acos:function(n ){
            return (m.acos(n)/degToRads);
            },
            asin:function(n ){
            return (m.asin(n)/degToRads);
            },
            atan:function(n ){
            return (m.atan(n)/degToRads);
            },
            atan2:function( y, x){
            return (m.atan2(y, x)/degToRads);
            },
            cos:function(d) {
            return m.cos(d*degToRa ds);
            },
            sin:function(d) {
            return m.sin(d*degToRa ds);
            },
            tan:function(d) {
            return m.tan(d*degToRa ds);
            }
            });
            })();

            var sinOf_23 = degreeMath.sin( 23);

            -but that has got to be relatively inefficient. It would probably be
            better to bite the bullet and write the code to work with radians
            instead of degrees.

            Richard.


            Comment

            • Fox

              #7
              Re: degrees not radians



              Jeff Thies wrote:[color=blue]
              >
              > Is it possible to set the Math functions to use degrees instead of
              > radians?
              >
              > I'm working out some astronomical calculations and everything is in
              > degrees. All those conversions are driving me a bit crazy!
              >
              > Jeff[/color]


              When converting from degrees to radians, you are introducing a fair
              amount of rounding error -- don't think for a minute you're getting the
              16 digit accuracy JS attempts to deliver. At best, you get, maybe,
              reliably 12-13, but you can push it a little at about 14 digits.

              You cannot prototype the Math object -- that feature was either
              overlooked or its lack was intended to dissuade people from making
              changes or additions to the object...howeve r, JS being what it is... you
              can just "glom" on whatever you want... the "this" refers to Math. All
              the following have been adjusted to trim the precision a couple of
              places (I hate it when IE says the Sin of 30 degrees is
              0.4999999999999 998).

              The "degrees version" of the trig functions are Capitalized as opposed
              to the radian versions (for simplification) .

              Also for simplification, I've used 'with (this)' to remove the necessity
              of repeatedly typing "Math." or "this.", so, sin means Math.sin (or
              this.sin) and PI means Math.PI, etc...

              The precision correction is set up this way to try to provide a small
              performance boost (over repeatedly calling the expanded form) -- set the
              desired precision at the beginning of your script -- there will be some
              instances where you might want to reduce the precision to about 12 (for
              example, take the sine of a number, then perform Asin -- there will be
              more error introduced:: Math.Asin(Math. Sin(18)) returns
              18.000000000000 16 -- first get the result of the computation, then set
              the precision to 12 to trim it back to 18, then reset the precision back
              to 14).


              Math.setPrecisi on = function(digits ) {
              this._prec = this.pow(10, this.round(digi ts)); // cannot have
              fractional digits
              }
              Math.setPrecisi on(14);

              Math.toPrecisio n = function(x) { with(this) return round(x *
              _prec)/_prec; }

              Math._2rad = Math.PI/180;
              Math._2deg = 180/Math.PI;

              Math.Sin = function(x) { with(this) return toPrecision(sin (x * _2rad)); }
              Math.Cos = function(x) { with(this) return toPrecision(cos (x * _2rad)); }
              Math.Tan = function(x) { with(this) return toPrecision(tan (x * _2rad)); }

              Math.Atan2 = function(a, b)
              { with(this) return toPrecision(ata n2(a * _2rad, b * _2rad) *
              _2deg); }

              Math.Asin = function(x) { with(this) return toPrecision(asi n(x) *
              _2deg); }
              Math.Acos = function(x) { with(this) return toPrecision(aco s(x) *
              _2deg); }

              These should serve as model enough for you to carry out the rest...


              Good luck with your astronomy... The precision of JS isn't really up to
              the task of remarkable accuracy, but it will get close enough to be
              useful to backyard astronomers...

              Comment

              • Dr John Stockton

                #8
                Re: degrees not radians

                JRS: In article <3FE2804E.4627B 4A8@spam.com>, seen in
                news:comp.lang. javascript, Fox <dont@spam.co m> posted at Thu, 18 Dec
                2003 22:36:30 :-
                [color=blue]
                >Jeff Thies wrote:[color=green]
                >>
                >> Is it possible to set the Math functions to use degrees instead of
                >> radians?
                >>
                >> I'm working out some astronomical calculations and everything is in
                >> degrees. All those conversions are driving me a bit crazy![/color][/color]
                [color=blue]
                >When converting from degrees to radians, you are introducing a fair
                >amount of rounding error -- don't think for a minute you're getting the
                >16 digit accuracy JS attempts to deliver. At best, you get, maybe,
                >reliably 12-13, but you can push it a little at about 14 digits.[/color]

                I do not at all see why that should be, provided that an accurate value
                for Pi is used; and Math.PI appears accurate.

                [color=blue]
                >You cannot prototype the Math object -- that feature was either
                >overlooked or its lack was intended to dissuade people from making
                >changes or additions to the object...howeve r, JS being what it is... you
                >can just "glom" on whatever you want... the "this" refers to Math. All
                >the following have been adjusted to trim the precision a couple of
                >places (I hate it when IE says the Sin of 30 degrees is
                >0.499999999999 9998).[/color]

                Does it? I find no numbers between 0.4999999999999 9994 and 0.5

                Working in radians, except for I/O, should be quicker; however, I
                suppose one could create a new Object called Deg with methods that use
                Math internally.


                --
                © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk / ??.Stockton@phy sics.org ©
                Web <URL:http://www.merlyn.demo n.co.uk/> - FAQish topics, acronyms, & links.
                Correct <= 4-line sig. separator as above, a line precisely "-- " (SoRFC1036)
                Do not Mail News to me. Before a reply, quote with ">" or "> " (SoRFC1036)

                Comment

                • Thomas 'PointedEars' Lahn

                  #9
                  Re: degrees not radians

                  Fox wrote:
                  [color=blue]
                  > You cannot prototype the Math object -- that feature was either
                  > overlooked[/color]

                  No.
                  [color=blue]
                  > or its lack was intended[/color]

                  Yes. It does not make sense to have more than one Math object.
                  [color=blue]
                  > to dissuade people from making changes or additions to the object...[/color]

                  No. You can add properties to Math as to any other object.
                  You can overwrite existing properties as well. See for example

                  [color=blue]
                  > Math.setPrecisi on = function(digits ) {
                  > this._prec = this.pow(10, this.round(digi ts)); // cannot have
                  > fractional digits
                  > }
                  > Math.setPrecisi on(14);[/color]

                  You are already adding properties to the Math object and use them.
                  What else do you want? :)


                  PointedEars

                  Comment

                  • Fox

                    #10
                    Re: degrees not radians



                    Thomas 'PointedEars' Lahn wrote:[color=blue]
                    >
                    > Fox wrote:
                    >[color=green]
                    > > You cannot prototype the Math object -- that feature was either
                    > > overlooked[/color]
                    >
                    > No.[/color]

                    You can prototype every other object, including Object (just about --
                    other exceptions: navigator, history)... so why not the Math object? The
                    error generated states that prototype is not a method of the object.[color=blue]
                    >[color=green]
                    > > or its lack was intended[/color]
                    >
                    > Yes. It does not make sense to have more than one Math object.[/color]

                    prototyping is not instantiation (which, by the way, can be done -- even
                    though Math has no constructor) -- but it *does* make sense to be able
                    to add custom functionality -- which *is* the purpose of prototype.
                    [color=blue]
                    >[color=green]
                    > > to dissuade people from making changes or additions to the object...[/color]
                    >
                    > No. You can add properties to Math as to any other object.[/color]

                    The "standard" way is via prototype... (is my face turning blue?)
                    [color=blue]
                    > You can overwrite existing properties as well. See for example
                    > http://pointedears.de.vu/scripts/math.js[/color]

                    I looked through this entire document...seve ral times... and didn't see
                    one instance where a property (OR a method) of Math had been overwritten
                    -- help me out here -- what's overwritten?

                    I found all the following had an assignation:

                    Math.roundDigit s
                    Math.gcd
                    Math.powInt
                    Math.power
                    Math.logN
                    Math.log2
                    Math.log10
                    Math.rec
                    Math.getPeriod
                    Math.root
                    Math.sqr
                    Math.cub
                    Math.cubrt
                    Math.dec2base
                    Math.randomNumb er
                    Math.randomInte ger
                    Math.binomCoeff

                    I don't recognize any of these as standard methods of the Math object
                    and I found no instance anywhere where any of the following standard
                    properties were reassigned (overwritten)

                    Math.E
                    Math.LN10
                    Math.LN2
                    Math.LOG10E
                    Math.LOG2E
                    Math.PI
                    Math.SQRT1_2
                    Math.SQRT2

                    [color=blue]
                    >[color=green]
                    > > Math.setPrecisi on = function(digits ) {
                    > > this._prec = this.pow(10, this.round(digi ts)); // cannot have
                    > > fractional digits
                    > > }
                    > > Math.setPrecisi on(14);[/color]
                    >
                    > You are already adding properties to the Math object and use them.[/color]

                    Yes I am -- have for years...
                    [color=blue]
                    > What else do you want? :)[/color]

                    I can be pretty dense sometimes -- I don't get this question. What else
                    *can* I do? I can add methods and properties and I can instantiate the
                    Math object. I can have the static "instance" remain the same and
                    customize the instantiated object to the hilt (and it is actually *safe*
                    to override methods in the copy since the original static Math is still
                    there for backside support).

                    What I want from Math is long double precision (64-bit). Just about
                    every platform has implemented it for at least the last 5 years (or
                    more!). With it, we could get considerably more precision. Astronomy
                    (solar system orbital mechanics) has been a long time programming
                    interest of mine (since the days of 8-bit processors). I want the
                    *option* to switch from standard 32-bit doubles to double precision long
                    doubles since it is not always necessary to run at such high precision
                    [sometimes I'll trade performance for precision.] It would be *nice* if
                    a selector option could be set so that trig functions would accept
                    either radian or degree arguments (or gradians). I would like a *native*
                    log (base 10) method. I would like *native* precision handlers (anything
                    scripted is considerably slower). I would like a native fixed point and
                    integer math package. How about Hyperbolic functions? Matrix operations?
                    .... ...

                    Comment

                    • Lasse Reichstein Nielsen

                      #11
                      Re: degrees not radians

                      Fox <dont@spam.co m> writes:
                      [color=blue]
                      > You can prototype every other object, including Object[/color]

                      Object is not an object[1], it is a function/constructor. It can be
                      used to create objects. You can change the prototype connected to
                      *those* objects.

                      Math, in comparison, is already an object, not a constructor. You
                      don't have access to its constructor or its prototype (well, actually
                      you do, because it's prototype is the same as for other objects
                      created from Object (check "Math instanceof Object").
                      [color=blue]
                      >(just about --
                      > other exceptions: navigator, history)... so why not the Math object?[/color]

                      Both exceptions are also singular objects, not objects that there are
                      more than one of.
                      [color=blue]
                      > The error generated states that prototype is not a method of the
                      > object.[/color]

                      Because it isn't. There is no Math.prototype, because Math is not
                      a function. It is an object.
                      [color=blue]
                      > prototyping is not instantiation (which, by the way, can be done -- even
                      > though Math has no constructor) -- but it *does* make sense to be able
                      > to add custom functionality -- which *is* the purpose of prototype.[/color]

                      What *is* prototyping to you?

                      To me, a prototype based object oriented language (as opposed to a class
                      based one) distinguishes itself in the way new objects are created.

                      In a class based language, new instances are based on a class.
                      In a prototype based language, new instances are based on an object.

                      That changing a property of the prototype of an object is also visible
                      on the object, is not a requirement. It is one way to implement it,
                      and the one often taken in dynamic languages where you can dynamically
                      add properties.

                      "Prototypin g" is not distinct from instantiation to me, because
                      prototyping is describing how instantiation happens.


                      So, the purpose of prototyping is *not* to be able to add properties
                      to objects. It is the ability to make objects from other objects.

                      Adding properties to objects can be done directly on the objects.

                      The only place where prototyping and adding properties interact, is
                      when you want to add properties to several related objects at once.
                      There is only one Math object, so that is completely unnecessary.
                      [color=blue][color=green]
                      >> No. You can add properties to Math as to any other object.[/color]
                      >
                      > The "standard" way is via prototype... (is my face turning blue?)[/color]

                      I don't know, but you are wrong.
                      The "standard" way (if any such exist) to add properties to an
                      object, is by assigning it directly to the object.
                      [color=blue]
                      > I looked through this entire document...seve ral times... and didn't see
                      > one instance where a property (OR a method) of Math had been overwritten
                      > -- help me out here -- what's overwritten?[/color]

                      I don't know, didn't check the page. But if you dind't find it, then
                      make it yourself:


                      function changeMath() {
                      var oldPI = Math.PI;
                      var oldSin = Math.sin;
                      Math.PI = 3;
                      Math.sin = function(tr) {return oldSin(tr/3*oldPI);};
                      }

                      changeMath();
                      alert([Math.sin(Math.P I),
                      Math.cos(Math.P I)]);
                      // normally alerts 0,-1
                      // now alerts -0.1477...,-1
                      // because Math.sin is changed but Math.PI is read only.
                      [color=blue]
                      > I can be pretty dense sometimes -- I don't get this question. What else
                      > *can* I do?[/color]

                      Ok, why do you want to do it differently?
                      [color=blue]
                      > I can add methods and properties and I can instantiate the
                      > Math object.[/color]

                      No, you never instantiated the Math object. It is not a constructor.
                      [color=blue]
                      > I can have the static "instance" remain the same and
                      > customize the instantiated object to the hilt (and it is actually *safe*
                      > to override methods in the copy since the original static Math is still
                      > there for backside support).[/color]

                      Yes, that is fairly simple:

                      function cloneMath() {
                      function nop(){};
                      nop.prototype = Math;
                      return new nop();
                      }

                      [color=blue]
                      > What I want from Math is long double precision (64-bit). Just about
                      > every platform has implemented it for at least the last 5 years (or
                      > more!).[/color]

                      Numbers in ECMAScript are 64-bit double precission IEEE-754 numbers.
                      I don't know what the difference between that and 64-bit "long double"
                      is.
                      [color=blue]
                      > With it, we could get considerably more precision. Astronomy
                      > (solar system orbital mechanics) has been a long time programming
                      > interest of mine (since the days of 8-bit processors). I want the
                      > *option* to switch from standard 32-bit doubles to double precision long
                      > doubles since it is not always necessary to run at such high precision
                      > [sometimes I'll trade performance for precision.] It would be *nice* if
                      > a selector option could be set so that trig functions would accept
                      > either radian or degree arguments (or gradians).[/color]

                      That should be possible, but you can do that yourself too. Not as
                      efficiently, ofcourse.

                      Math.inputMode = 0; // 0 is radians, 1 is degress:
                      function dispatch(func) {
                      return function(n){swi tch (this.inputMode ) {
                      case 1: return this.call(func, n/180*Math.PI);
                      default: return this.call(func, n);
                      }};
                      }
                      Math.sin = dispatch(Math.s in);
                      Math.cos = dispatch(Math.c os);
                      Math.tan = dispatch(Math.t an);
                      [color=blue]
                      > I would like a *native* log (base 10) method.[/color]


                      Is the efficiency of:
                      Math.log10 = function(n) {return Math.log(n)*Mat h.LOG10E;}
                      that bad?
                      [color=blue]
                      > I would like *native* precision handlers (anything
                      > scripted is considerably slower). I would like a native fixed point and
                      > integer math package. How about Hyperbolic functions? Matrix operations?[/color]

                      You want more. No problem with that :) You just shouldn't hold your
                      breath waiting for a high-performance super math package to be
                      implemented in a browser scripting language. It's not that much in
                      demand.

                      /L
                      --
                      Lasse Reichstein Nielsen - lrn@hotpop.com
                      DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
                      'Faith without judgement merely degrades the spirit divine.'

                      Comment

                      • Lasse Reichstein Nielsen

                        #12
                        Re: degrees not radians

                        Lasse Reichstein Nielsen <lrn@hotpop.com > writes:
                        [color=blue]
                        > Fox <dont@spam.co m> writes:
                        >[color=green]
                        >> You can prototype every other object, including Object[/color]
                        >
                        > Object is not an object[1], it is a function/constructor.[/color]

                        and the missing footnote should say
                        [1] ... except that functions are objects too, and their prototype is
                        Function.protot ype.

                        /L[color=blue]
                        >--[/color]
                        Lasse Reichstein Nielsen - lrn@hotpop.com
                        DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
                        'Faith without judgement merely degrades the spirit divine.'

                        Comment

                        • Thomas 'PointedEars' Lahn

                          #13
                          Re: degrees not radians

                          Fox wrote:
                          [color=blue]
                          > Thomas 'PointedEars' Lahn wrote:[color=green]
                          >> Fox wrote:
                          >> You can overwrite existing properties as well. See for example
                          >> http://pointedears.de.vu/scripts/math.js[/color]
                          >
                          > I looked through this entire document...seve ral times... and didn't see
                          > one instance where a property (OR a method) of Math had been overwritten
                          > -- help me out here -- what's overwritten?[/color]

                          Until now? Nothing. I referred to the previous sentence, note the context.
                          [color=blue]
                          > I don't recognize any of these as standard methods of the Math object[/color]

                          Would I need to define them then?
                          [color=blue]
                          > and I found no instance anywhere where any of the following standard
                          > properties were reassigned (overwritten)[/color]

                          Of course. Why reinventing the wheel?


                          PointedEars

                          Comment

                          • Dr John Stockton

                            #14
                            Re: degrees not radians

                            JRS: In article <3FE3EF31.61509 02E@spam.com>, seen in
                            news:comp.lang. javascript, Fox <dont@spam.co m> posted at Sat, 20 Dec
                            2003 00:41:53 :-
                            [color=blue]
                            >What I want from Math is long double precision (64-bit).[/color]

                            You already have, in standard javascript, all numbers being IEEE 64-bir
                            Doubles, with 53 bits of numeric resolution. Have you not seen FAQ 4.7?

                            Or do you mean the 80-bit type, called "extended" in Pascal & Delphi?

                            [color=blue]
                            >Just about
                            >every platform has implemented it for at least the last 5 years (or
                            >more!). With it, we could get considerably more precision. Astronomy
                            >(solar system orbital mechanics) has been a long time programming
                            >interest of mine (since the days of 8-bit processors). I want the
                            >*option* to switch from standard 32-bit doubles[/color]

                            What could standard 32-bit doubles be? IEEE singles are 32-bit, with 24
                            bits of resolution.
                            [color=blue]
                            > to double precision long
                            >doubles since it is not always necessary to run at such high precision
                            >[sometimes I'll trade performance for precision.] It would be *nice* if
                            >a selector option could be set so that trig functions would accept
                            >either radian or degree arguments (or gradians). I would like a *native*
                            >log (base 10) method. I would like *native* precision handlers (anything
                            >scripted is considerably slower). I would like a native fixed point and
                            >integer math package. How about Hyperbolic functions? Matrix operations?[/color]


                            The proportion of javascript-enabled browser users who would be
                            interested in pages using that is very small.

                            The proportion of javascript authors who can use Math to the full is
                            very small.

                            The proportion of those who cannot implement those functions themselves,
                            or need speed greater that self-implementing would produce, is
                            insignificant - it is commercially-negligible. Therefore, you should
                            not expect to see it come.

                            The only omission that would make commercial sense to rectify is the
                            lack of an ECMA-standard means to convert from Number to given-length
                            String with a given number of decimal places shown; for that, see the
                            FAQ.


                            Please give a proper name - we are accustomed to seeing Fox Mahoney
                            here, and posting as Fox can cause confusion.

                            --
                            © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
                            <URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang. javascript
                            <URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
                            <URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.

                            Comment

                            • Fox

                              #15
                              Re: degrees not radians



                              Thomas 'PointedEars' Lahn wrote:[color=blue]
                              >
                              > Fox wrote:
                              >[color=green]
                              > > Thomas 'PointedEars' Lahn wrote:[color=darkred]
                              > >> Fox wrote:
                              > >> You can overwrite existing properties as well. See for example
                              > >> http://pointedears.de.vu/scripts/math.js[/color]
                              > >
                              > > I looked through this entire document...seve ral times... and didn't see
                              > > one instance where a property (OR a method) of Math had been overwritten
                              > > -- help me out here -- what's overwritten?[/color]
                              >
                              > Until now? Nothing.[/color]

                              Then how is math.js an example?
                              [color=blue]
                              > I referred to the previous sentence, note the context.[/color]

                              I did -- it says: you can overwrite existing properties as well. See
                              for example [url...]

                              In context, it looks like you meant to show me examples of overwriting
                              existing properties...

                              I *still* read it that way...
                              [color=blue]
                              >[color=green]
                              > > I don't recognize any of these as standard methods of the Math object[/color]
                              >
                              > Would I need to define them then?[/color]

                              only if you had actually overridden them...
                              [color=blue]
                              >[color=green]
                              > > and I found no instance anywhere where any of the following standard
                              > > properties were reassigned (overwritten)[/color]
                              >
                              > Of course. Why reinventing the wheel?[/color]

                              you had me going there for awhile...
                              [color=blue]
                              >
                              > PointedEars[/color]

                              Comment

                              Working...