Thanks Jimmy. When I translated you answer into J, I got the same result. But,
if the csc of a number isundefined, should the signum be 1?
load 'plot'
do=: 13 : '({.y) +(i.{:y)*(--/ 2{.y)%<:{:y'
A=:do 0 2p1 17
]csc=:*1%1 o. A
1 1 1 1 1 1 1 1 1 _1 _1 _1 _1 _1 _1 _1 _1
]sec=:*1%2 o. A
1 1 1 1 1 _1 _1 _1 _1 _1 _1 _1 _1 1 1 1 1
]csc=:1%3 o. 0{A
_
]csc=:*1%3 o. 0{A
1
Linda
-----Original Message-----
From: Programming [mailto:[email protected]] On Behalf
Of Jimmy Gauvin
Sent: Tuesday, August 15, 2017 10:57 PM
To: [email protected]
Subject: Re: [Jprogramming] Fwd: FW: why are there no negative signs for cot,
sec and csc?
No zeroes for sec or csc, from the definition:
csc A = 1 / (sin A)
sec A = 1 / (cos A)
cot A = 1 / (tan A)
sin and cos vary from 1 to -1 passing by zero so there is no way of getting a
zero from 1/sin or 1/cos
tan on the other hand varies from plus infinity to minus infinity so you obtain
zeroes from 1/tan when tan is at the limits of its domain
On Tue, Aug 15, 2017 at 8:13 PM, Linda Alvord <[email protected]>
wrote:
> Thanks Raul. It shows that I haven't used J for any trig in aboug 20
> years. Here is almost what I want.
>
>
> Hoever the cot looks good. Shouldn't there be some 0's in the sec and csc?
>
> *(%"0)3 2 1 (o."0 1) t
> 1 1 1 1 0 _1 _1 _1 _1 1 1 1 0 _1 _1 _1 _1
> 1 1 1 1 1 _1 _1 _1 _1 _1 _1 _1 _1 1 1 1 1
> 1 1 1 1 1 1 1 1 1 _1 _1 _1 _1 _1 _1 _1 _1
>
>
>
> Linda
>
>
> -----Original Message-----
> From: Programming [mailto:[email protected]] On
> Behalf Of Raul Miller
> Sent: Tuesday, August 15, 2017 1:50 PM
> To: Programming forum <[email protected]>
> Subject: Re: [Jprogramming] Fwd: FW: why are there no negative signs
> for cot, sec and csc?
>
> Or you could do:
>
> cot=: %@(tan=: 3&o.)
> sec=: %@(cos=: 2&o.)
> csc=: %@(sin=: 1&o.)
>
> Thanks,
>
> --
> Raul
>
>
> On Tue, Aug 15, 2017 at 1:11 PM, Jimmy Gauvin <[email protected]>
> wrote:
> > Hi,
> >
> > problem is with 4 5 6 which denote the following:
> >
> > coh=: 4&o. NB. sqrt (1+(y^2))
> > sinh=: 5&o. NB. hyperbolic sine of y
> > cosh=: 6&o. NB. hyperbolic cosine of y
> >
> > see: http://code.jsoftware.com/wiki/Vocabulary/odot#dyadic
> >
> > There dosen't seem to be specific numbers for cot, sec and csc.
> > You have to go by their definition:
> >
> > [image: \cot \theta ={\frac {\cos \theta }{\sin \theta }}=\tan
> \left({\frac
> > {\pi }{2}}-\theta \right)={\frac {1}{\tan \theta }}]
> >
> > [image: \sec \theta =\csc \left({\frac {\pi }{2}}-\theta
> > \right)={\frac {1}{\cos \theta }}]
> >
> > [image: \csc \theta =\sec \left({\frac {\pi }{2}}-\theta
> > \right)={\frac {1}{\sin \theta }}]
> >
> >
> >
> > On Tue, Aug 15, 2017 at 12:41 PM, Linda Alvord
> > <[email protected]>
> > wrote:
> >
> >>
> >>
> >> Sent from AOL Mobile Mail
> >>
> >>
> >> From: Linda Alvord <[email protected]>
> >> Date: Tuesday, August 15, 2017
> >> Subject: FW: why are there no negative signs for cot,sec and csc?
> >> Cc: lindaalvord <[email protected]>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> From: Linda Alvord [mailto:[email protected]]
> >> Sent: Tuesday, August 15, 2017 11:22 AM
> >> To: '[email protected]' <[email protected]>
> >> Subject: why are there no negative signs for cot,sec and csc?
> >>
> >>
> >>
> >> do=: 13 : '({.y) +(i.{:y)*(--/ 2{.y)%<:{:y'
> >>
> >> t=:do 0 2p1 17
> >>
> >> all=:1 2 3 4 5 6 (o."0 1) t
> >>
> >> *all
> >>
> >> 0 1 1 1 1 1 1 1 0 _1 _1 _1 _1 _1 _1 _1 0
> >>
> >> 1 1 1 1 0 _1 _1 _1 _1 _1 _1 _1 0 1 1 1 1
> >>
> >> 0 1 1 1 1 _1 _1 _1 0 1 1 1 1 _1 _1 _1 0
> >>
> >> 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
> >>
> >> 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
> >>
> >> 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
> >>
> >>
> >>
> >> Linda
> >>
> >> -------------------------------------------------------------------
> >> --- For information about J forums see
> >> http://www.jsoftware.com/forums.htm
> > --------------------------------------------------------------------
> > -- For information about J forums see
> > http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm