Skip to content

Naming conventions and terminology #260

Closed
@angularsen

Description

@angularsen

One thing I have repeatedly found tricky to name or describe, is how to refer to the concepts that Length and Force represent.

It is natural to refer to centimeters and newtons as units, or units of measure, but I always lacked a good name for their grouping/family. After some googling, it seems physical quantity is the correct term.

wiki/Units_of_measurement spells it out pretty well:

A unit of measurement is a definite magnitude of a quantity, defined and adopted by convention or by law, that is used as a standard for measurement of the same quantity.[1] Any other value of that quantity can be expressed as a simple multiple of the unit of measurement.

For example, length is a physical quantity. The metre is a unit of length that represents a definite predetermined length. When we say 10 metres (or 10 m), we actually mean 10 times the definite predetermined length called "metre".

Example :

You can convert between units of the same physical quantity.

Proposal (final, edited 2017-08-18)

  • Quantities are represented by struct types like Length and Force and corresponding enum types LengthUnit and ForceUnit
  • Units are represented by enum values like LengthUnit.Meter and ForceUnit.Newton
  • Unit conversions are represented by instance properties, such as Length.Meters and Force.Newtons and custom conversion methods like Force.FromPressureByArea()
  • Generic type parameters are named
    • TQuantity for unit struct types, such as Length
    • TUnitType for unit enum types, such as LengthUnit

Any thoughts on the matter?

I would like to go through the docs and source to ensure the wording is used consistently, as well as on future PR reviews.

Sources:
https://en.wikipedia.org/wiki/Physical_quantity
https://en.wikipedia.org/wiki/Units_of_measurement
https://en.wikipedia.org/wiki/Quantity
https://en.wikipedia.org/wiki/Metrology#Definition_of_units

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions