insect icon indicating copy to clipboard operation
insect copied to clipboard

sec & csc support

Open reteps opened this issue 6 years ago • 10 comments

I would love this for my math classes!

reteps avatar Oct 05 '19 17:10 reteps

Sounds good. Unfortunately, sec is a reserved keyword (for second). Apart from this, we could easily add this to purescript-units and (subsequently) to Insect.

sharkdp avatar Oct 06 '19 18:10 sharkdp

awesome!

reteps avatar Oct 07 '19 13:10 reteps

Note that you also use insect to define the functions yourself:

secant(x)=1/cos(x)
cosecant(x)=1/sin(x)

sharkdp avatar Mar 15 '20 11:03 sharkdp

Should I add csc and sec to Quantities before adding them to Insect, seeing as that's where the whole bunch of trigonometric functions are?

triallax avatar Mar 24 '22 19:03 triallax

Should I add csc and sec to Quantities before adding them to Insect, seeing as that's where the whole bunch of trigonometric functions are?

yes, that would be great. Maybe let's directly name them secant/cosecant to avoid the clash with sec?

sharkdp avatar Mar 24 '22 21:03 sharkdp

While I can understand the rationale for doing that in Insect, I don't see a reason to not use the abbreviated names in purescript-quantities, because all the unit names there are spelled out fully, and it would be inconsistent with all the other abbreviated trigonometric function names in purescript-quantities.

Another thing, do we want to add csc to Insect? The clash applies only to secant and second, not cosecant.

triallax avatar Mar 25 '22 09:03 triallax

While I can understand the rationale for doing that in Insect, I don't see a reason to not use the abbreviated names in purescript-quantities, because all the unit names there are spelled out fully, and it would be inconsistent with all the other abbreviated trigonometric function names in purescript-quantities.

Ok, agreed!

Another thing, do we want to add csc to Insect? The clash applies only to secant and second, not cosecant.

Hmm. I don't like that it's inconsistent. But I'm fine with adding csc. Maybe we could simply add cosecant as well. And for secant, we simply omit the short version.

sharkdp avatar Mar 25 '22 21:03 sharkdp

Another option popped into my mind, which is to add the full names for all trigonometric functions besides the abbreviated ones (e.g. sine and cosine), sans sec of course. So basically, our options now are:

  • Add csc and secant only
  • Add csc, cosecant, and secant
  • Add full names for all trigonmetric functions (including cosecant and secant), but don't add sec

Naturally, no option is completely consistent, so which one to choose is subjective. What do you think?

triallax avatar Mar 26 '22 13:03 triallax

Thanks for writing this up. I think I would vote for option two:

Add csc, cosecant, and secant

Adding full names for all trig. functions is an interesting idea, but I have never seen someone use cosine(…). On the other hand, for those more exotic variants, it might be nice to write them out completely to make sure that Insects csc is really the function that I'm looking for (cosecant).

sharkdp avatar Mar 27 '22 21:03 sharkdp

I also think option two is the best, so I guess I'll go ahead with that unless somebody brings up a case for another option.

triallax avatar Mar 28 '22 13:03 triallax