Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support constant for phi #246

Closed
brianrodri opened this issue Jan 28, 2021 · 4 comments · Fixed by #327
Closed

Support constant for phi #246

brianrodri opened this issue Jan 28, 2021 · 4 comments · Fixed by #327
Assignees
Milestone

Comments

@brianrodri
Copy link

brianrodri commented Jan 28, 2021

My most-common use case for insect happens to be calculating column widths using phi (aka the Golden ratio).

It'd be very nice to have it defined as a global-constant, where

phi = φ = (1 + sqrt(5)) / 2
@sharkdp
Copy link
Owner

sharkdp commented Jan 29, 2021

Sounds great - thank you!

The only concern I have is to use phi as the name. phi is quite a common variable name for a general angle. Maybe we could simply introduce it as golden_ratio? It's quite a bit longer, but we have tab completion. What do you think?

@bitzl
Copy link

bitzl commented Jan 3, 2022

I just was about to open the same issue - any news on this?

Personally, I wouldn't care if it's phi or golden_ratio since there is tab completion.

Please tell me if there is anything I could do to help to add this feature.

@sharkdp
Copy link
Owner

sharkdp commented Jan 3, 2022

To be honest, I do not recall why I reverted the changes in sharkdp/purescript-quantities#40 in sharkdp/purescript-quantities@8ee17b7. Probably they caused some issues when I reactivated CI. If you want to help, you could attempt to re-open a new PR in purescript-quantities that includes the changes from sharkdp/purescript-quantities#40.

triallax added a commit to triallax/purescript-quantities that referenced this issue May 19, 2022
sharkdp pushed a commit to sharkdp/purescript-quantities that referenced this issue May 19, 2022
@triallax
Copy link
Contributor

I've already added phi to purescript-quantities and will add it to Insect soon, but in the meanwhile you can put this in your insectrc file (#248):

phi = (1 + sqrt(5)) / 2

@triallax triallax self-assigned this Jul 20, 2022
@triallax triallax added this to the v5.8.0 milestone Jul 20, 2022
triallax added a commit to triallax/insect that referenced this issue Jul 27, 2022
triallax added a commit to triallax/insect that referenced this issue Jul 27, 2022
triallax added a commit that referenced this issue Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants