JJ / p6-math-constants

A few Mathematics and Physics constants
GNU General Public License v3.0
8 stars 11 forks source link

Add more constants #5

Open JJ opened 7 years ago

JJ commented 7 years ago

Add a mathematical or physical constant with its corresponding test.

hsmyers commented 3 years ago

As long as you are adding new constants, here are some I didn't see and would like to:

--Artin's Constant https://oeis.org/A005596 --Base of the natural logarithm https://oeis.org/A081368 --Bernstein's Constant https://oeis.org/A073001 --Degree https://oeis.org/A072097 --Euler's Constant https://oeis.org/A002852 --Gelfond-Schneider Constant https://oeis.org/A078333 --Landau-Ramanujan Constant https://oeis.org/A064533 --Mandelbrot Set Area https://oeis.org/A098403 --Merten's Constant https://oeis.org/A077761 --Pi https://oeis.org/A000796 --Pythagora's Constant https://oeis.org/A322641 --Silver Ratio https://oeis.org/A014176 --Twin prime Constant https://oeis.org/A065645 --Zeta Function, Zeta(2) https://oeis.org/A013661 --i^i https://oeis.org/A049006

I've added the OEIS page for each. With those like Pi, Degree, 'e' etc., I may not have looked in the right place?

librasteve commented 3 years ago

hi @hsmyers --- fwiw pi(π) and e(𝑒) are already built in terms in raku (https://docs.raku.org/language/terms) --- and there is some support for Degree over at Physics::Measure

#Angles use degrees/minutes/seconds or decimal radians
    my $θ1 ♎️ <45°30′30″>;      #45°30′30″ (using <> to deconfuse quotation marks)
    my $θ2 ♎️ '2.141 radians';  #'2.141 radian'
#NB. The unit name 'rad' is reserved for the unit of radioactive Dose

# Trigonometric functions sin, cos and tan (and arc-x) handle Angles
    my $sine = sin( $θ1 );      #0.7133523847299412
    my $arcsin = asin( $sine, units => '°' ); #45°30′30″
#NB. Provide the units => '°' tag to tell asin you want degrees back
hsmyers commented 3 years ago

Kinda thought they might be. Good to know where they 'live' though—thanks @ p6steve!

On Mon, Aug 30, 2021 at 9:43 AM p6steve @.***> wrote:

hi @hsmyers https://github.com/hsmyers --- fwiw pi(π) and e(𝑒) are already built in terms in raku (https://docs.raku.org/language/terms) --- and there is some support for Degree over at Physics::Measure https://github.com/p6steve/raku-Physics-Measure

Angles use degrees/minutes/seconds or decimal radians

my $θ1 ♎️ <45°30′30″>; #45°30′30″ (using <> to deconfuse quotation marks) my $θ2 ♎️ '2.141 radians'; #'2.141 radian'

NB. The unit name 'rad' is reserved for the unit of radioactive Dose

Trigonometric functions sin, cos and tan (and arc-x) handle Angles

my $sine = sin( $θ1 ); #0.7133523847299412

my $arcsin = asin( $sine, units => '°' ); #45°30′30″

NB. Provide the units => '°' tag to tell asin you want degrees back

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/JJ/p6-math-constants/issues/5#issuecomment-908451499, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHE7PU5EGOLXUQO7CIAB7LT7ORK5ANCNFSM4EADUXQA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.