Newsgroups: comp.lang.apl
Path: watmath!watserv1!utgpu!news-server.csri.toronto.edu!torsqnt!jtsv16!itcyyz!yrloc!hui
From: hui@yrloc.ipsa.reuter.COM (Roger Hui)
Subject: Re: yet more questions on J
Message-ID: <1992Feb8.054930.23851@yrloc.ipsa.reuter.COM>
Organization: Iverson Software Inc.
References: <1992Feb3.171845.18367@csi.jpl.nasa.gov> <ROCKWELL.92Feb3232258@socrates.umd.edu>
Date: Sat, 8 Feb 92 05:49:30 GMT

Raul Rockwell writes:
 
>    ...
> By the way, anyone know what to call the results of '..' and '.:' in
> J 4?  For example:
>
>    f .. g
> +-+---------+-------+
> |f|+--+--+-+|+-+-+-+|
> | ||-:|@:|+|||f|&|g||
> | |+--+--+-+|+-+-+-+|
> +-+---------+-------+
>    f .: g
> +-+---------+-------+
> |f|+--+--+-+|+-+-+-+|
> | ||-:|@:|-|||f|&|g||
> | |+--+--+-+|+-+-+-+|
> +-+---------+-------+
>
> Looks like averaging of some sort, but I'm not sure I know how to use
> this.
 
    sin  =. 1&o.   [.   sn   =. j.^:_1 @ (^@j. .: -)
    cos  =. 2&o.   [.   cs   =. ^@j. .. -
    sinh =. 5&o.   [.   snh  =. ^    .: -
    cosh =. 6&o.   [.   csh  =. ^    .. -
 
    ] a =. ^ j. ?2 3$100
 0.907447j0.420167 0.921751j_0.387782   0.525322j0.850904
_0.918283j0.395925 _0.547729j0.836656 _0.653644j_0.756802
 
   (sin -: sn) a
1
   (cos -: cs) a
1
   (sinh -: snh) a
1
   (cosh -: csh) a
1

------------------------------------
Roger Hui, Iverson Software Inc., 33 Major Street, Toronto, Ontario  M5S 2K9
Phone: (416) 925 6096;  Fax: (416) 488 7559
