Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #30808

Re: Impact of implicit arrays...

From "Chris M. Thomasson" <invalid@invalid.invalid>
Newsgroups comp.lang.javascript
Subject Re: Impact of implicit arrays...
Date 2016-07-01 13:52 -0700
Organization n/a
Message-ID <nl6l6u$k7j$1@dont-email.me> (permalink)
References (7 earlier) <994a5f96-b90f-4078-8626-543bf6a2e9e6@googlegroups.com> <nkhkt6$dfv$1@dont-email.me> <bc601b80-611c-4775-9343-f425f0de0326@googlegroups.com> <nkn9kd$kfc$1@dont-email.me> <fd54b793-af20-4c86-8c64-064fdba4bd24@googlegroups.com>

Show all headers | View raw


On 6/25/2016 6:24 PM, Michael Haufe (TNO) wrote:
> On Saturday, June 25, 2016 at 8:03:15 PM UTC-5, Chris M. Thomasson wrote:
>> On 6/24/2016 7:16 AM, Michael Haufe (TNO) wrote:
>
>>>> What do you think of this? Is it a bit too contrived?
>>>
>>> What do the arrays represent in this case? Before it was [Re,Im]
>>>
>>
>> x, y, z, w? I admit this is highly contrived wrt justifying arrays via
>> looping... ;^o
>
> You can represent Complex Numbers as Matrices as well if you want. It's been 2 years or so since I did much Linear Algebra, so I'd have to brush up again on the subject to provide any insight if you go in that direction though.
>
> Basically given two Matrices:
>
> // 2x2 Identity matrix
> var I = [
>   1, 0,
>   0, 1
> ]
>
> // J**2 == -I
> // eigenvalues(J) == [i, -i] where i = sqrt(-1)
> var J = [
>   0, -1,
>   1, 0
> ]
>
> You can represent the complex number a + bi instead as the matrix aI + bJ and get all the benefits of matrix operations. I would still suggest having an object to represent these of course.
Ah yes. agreed. I think I like the array approach a little better 
because a user can pass a number like:

foo.bar([.1, .2])

instead of:

foo.bar(new complex(.1, .2))

This is contrived, but I have always liked arrays wrt storing x, y, z, 
w, ... like parameters.

Back to comp.lang.javascript | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Impact of implicit arrays... "Chris M. Thomasson" <nospam@nospam.com> - 2016-06-11 10:52 -0700
  Re: Impact of implicit arrays... Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-06-12 12:16 +0200
    Re: Impact of implicit arrays... "Chris M. Thomasson" <nospam@nospam.com> - 2016-06-13 12:23 -0700
  Re: Impact of implicit arrays... "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-06-13 22:00 -0700
    Re: Impact of implicit arrays... "Chris M. Thomasson" <nospam@nospam.com> - 2016-06-14 17:17 -0700
      Re: Impact of implicit arrays... Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-06-15 06:55 +0200
      Re: Impact of implicit arrays... "Chris M. Thomasson" <nospam@nospam.invalid> - 2016-06-14 22:19 -0700
      Re: Impact of implicit arrays... "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-06-18 12:47 -0700
        Re: Impact of implicit arrays... "Chris M. Thomasson" <invalid@invalid.invalid> - 2016-06-21 14:43 -0700
          Re: Impact of implicit arrays... "Christoph M. Becker" <cmbecker69@arcor.de> - 2016-06-22 00:10 +0200
            Re: Impact of implicit arrays... "Chris M. Thomasson" <invalid@invalid.invalid> - 2016-06-21 15:28 -0700
              Re: Impact of implicit arrays... "Chris M. Thomasson" <invalid@invalid.invalid> - 2016-06-21 15:31 -0700
                Re: Impact of implicit arrays... "Christoph M. Becker" <cmbecker69@arcor.de> - 2016-06-22 11:55 +0200
                Re: Impact of implicit arrays... "Chris M. Thomasson" <invalid@invalid.invalid> - 2016-06-23 12:23 -0700
                Re: Impact of implicit arrays... "Chris M. Thomasson" <invalid@invalid.invalid> - 2016-06-23 14:14 -0700
                Re: Impact of implicit arrays... "Chris M. Thomasson" <invalid@invalid.invalid> - 2016-06-23 14:16 -0700
                Re: Impact of implicit arrays... "Chris M. Thomasson" <invalid@invalid.invalid> - 2016-06-23 18:14 -0700
                Re: Impact of implicit arrays... "Chris M. Thomasson" <invalid@invalid.invalid> - 2016-06-23 18:46 -0700
          Re: Impact of implicit arrays... "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-06-21 17:35 -0700
            Re: Impact of implicit arrays... "Chris M. Thomasson" <invalid@invalid.invalid> - 2016-06-21 21:08 -0700
              Re: Impact of implicit arrays... "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-06-21 23:09 -0700
                Re: Impact of implicit arrays... "Chris M. Thomasson" <invalid@invalid.invalid> - 2016-06-23 14:38 -0700
                Re: Impact of implicit arrays... "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-06-24 07:16 -0700
                Re: Impact of implicit arrays... "Chris M. Thomasson" <invalid@invalid.invalid> - 2016-06-25 18:03 -0700
                Re: Impact of implicit arrays... "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-06-25 18:24 -0700
                Re: Impact of implicit arrays... "Chris M. Thomasson" <invalid@invalid.invalid> - 2016-07-01 13:52 -0700

csiph-web