Thx for a very good explanation.
I am not used to these kind of notation but it does make sense when you
explain it.

Now I hope someone can explain how to do a) and b)

2009/3/27 Dan Bron <[email protected]>

> Björn wrote:
> > c) I am curious of what this number 1r10800p1 is all about.
>
> That's conversion to arc minutes in radians, I think.  An arc minute is
>  1%60  of a degree or  (1%60) * pi%180  radians.  The notation  1r10800p1
>  is just a shorthand (atomic, single-word) way of expressing   (1%60) *
> pi%180  .
>
> Briefly:
>
>           (1%60) * pi%180
>           pi % (60 * 180)
>           pi % 10800
>           1p1 % 10800           NB.  1p1 means pi
>           1p1 * (1 % 10800)     NB.  Re-express to take advantage of J's
> constant hierarchy
>           (1 % 10800) * 1p1
>           1r10800 * 1p1
>           1r10800p1
>
> See how expressive (effort-saving) a good notation can be?
>
>           '3.0' 8!:2 (,. 100 * 1 - %/)(,.&#&>~;:&.>)   '1r10800p1' ;
> '(1%60) * 1p1%180'
>          1  9 89
>          9 16 44
>
> A savings of almost 50% in characters, and 90% in words.
>
> It gets even better when you consider the single-word version removes the
> requirement for parenthesis and/or assignment, since the value is used more
> than once, and always leftmost in an expression.
>
> -Dan
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm




-- 
Björn Helgason, Verkfræðingur
Fugl&Fiskur ehf,
Þerneyjarsundi 23, Hraunborgum
Po Box 127,801 Selfoss ,
t-póst: [email protected]
gsm: +3546985532
Landslags og skrúðgarðagerð, gröfuþjónusta
http://groups.google.com/group/J-Programming


Tæknikunnátta höndlar hið flókna, sköpunargáfa er meistari einfaldleikans

góður kennari getur stigið á tær án þess að glansinn fari af skónum
         /|_      .-----------------------------------.
        ,'  .\  /  | Með léttri lund verður        |
    ,--'    _,'   | Dagurinn í dag                     |
   /       /       | Enn betri en gærdagurinn  |
  (   -.  |        `-----------------------------------'
  |     ) |         (\_ _/)
 (`-.  '--.)       (='.'=)   ♖♘♗♕♔♙
  `. )----'        (")_(") ☃☠
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to