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

Suport for ISO 216 #28

Closed
adius opened this issue Feb 3, 2018 · 9 comments
Closed

Suport for ISO 216 #28

adius opened this issue Feb 3, 2018 · 9 comments

Comments

@adius
Copy link

adius commented Feb 3, 2018

https://en.wikipedia.org/wiki/ISO_216
Just lately I had to convert a few sizes for printing.
Would have been really handy 😁

@sharkdp
Copy link
Owner

sharkdp commented Feb 3, 2018

Hi, thank you for your feedback.

Was exactly is it that you are missing in ps-quantities (or Insect)?

@adius
Copy link
Author

adius commented Feb 3, 2018

Some examples:

  • What resolution does an A4 page with 300dpi have: A4 * 300^2 dots/in^2
    (would be cool to even be able to access the lengths of the sides - like A4-width, A4-height or something like that)
  • How many business cards can I approximately print on an A4 sheet: A4 / (85 mm * 55 mm)
  • What's the weight of 100 A4 pages @ 0.1 mm thickness: A4 * 0.1 mm * 800 kg / m^3

This were just a few examples off the top of my head.
I guess there are many more 😁.

@sharkdp
Copy link
Owner

sharkdp commented Feb 3, 2018

But all of this works after you define A4, right?

>>> A4 = 210 mm × 297 mm

  A4 = 62370 mm²

>>> A4 * 300^2 dots/in^2

  A4 × (300^2 × dot / in^2)

   = 8700630 dot

>>> A4 / (85 mm * 55 mm)

  A4 / (85 mm × 55 mm)

   = 13.3412

>>> 100 * A4 * 0.1 mm * 800 kg / m^3

  100 × A4 × 0.1 mm × (800 kg / m^3)

   = 0.49896 kg

I don't think I would like to add add A4 as a constant to purescript-quantities / Insect. There are soo many more things we would need to add. And it's not like the area of the A4 paper format is some kind of fundamental constant 😄.
Note that once we have sharkdp/insect#124, everyone is free to define his own constants.

@adius
Copy link
Author

adius commented Feb 3, 2018

It's not like the area of the A4 paper format is some kind of fundamental constant

Well, actually it is ^^ (At least as far as the meter is fundamental):

All paper sizes have the same aspect ratio, \sqrt{2}, within rounding to millimeters. This ratio has the unique property that when cut or folded in half width-wise, the halves also have the same aspect ratio. Each ISO paper size is one half of the area of the next larger size in the same series.

And the surface area of A0 is exactly 1 m^2.

@adius
Copy link
Author

adius commented Feb 3, 2018

Unfortunately due to rounding errors you can't: 1 × m^2 / 2^4 as 0.0625 m² /= 0.06237 m²

@sharkdp
Copy link
Owner

sharkdp commented Feb 3, 2018

Sorry for being nit-picky. I meant it's not a fundamental constant of nature like the speed of light or the mass of an electron. The fact that the area of A0 paper is (almost exactly) 1 m² is not a coincidence. It's because it has been designed this way. That doesn't make it anymore special or fundamental than if its value had been 0.743 m².

@adius
Copy link
Author

adius commented Feb 3, 2018

The fact that the area of A0 paper is (almost exactly) 1 m² is not a coincidence

Yes I know. That's what I'm saying. It's a derived unit like mm, cm, hectare, ...
and equally important. If not more important. (nobody should seriously use barn, but there is nothing which can easily replace the A series)

But I guess sharkdp/insect#124 is cool too. It would be really nice, however, if insect contained a default file with the most common units predefined (like e.g. https://en.wikipedia.org/wiki/GNU_Units)

@sharkdp
Copy link
Owner

sharkdp commented Feb 3, 2018

Yes I know. That's what I'm saying. It's a derived unit like mm, cm, hectare, ...
and equally important.

I'm sorry, but I disagree. I wouldn't consider "A4" to be a unit at all. The width, height and area of a A4 paper are physical quantities - but they are (typically) not used as units of measure.

nobody should seriously use barn,

I tend to agree, but it is still widely used in nuclear physics. You are right though, there are a lot of obscure units here in purescript-quantities.

It would be really nice, however, if insect contained a default file with the most common units predefined (like e.g. en.wikipedia.org/wiki/GNU_Units)

Yes, that'd be great! If I ever redesign the whole project, it's definitely something I would do differently (use a database of units instead of hardcoded units).

@adius
Copy link
Author

adius commented Feb 3, 2018

use a database of units instead of hardcoded units

On the other hand, how many can there be? I would just add all of them (the 99% most important).
How many more would it be? I'd guess a few hundred. Still easily manageable as code...

@sharkdp sharkdp closed this as completed May 18, 2018
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

No branches or pull requests

2 participants