-
Notifications
You must be signed in to change notification settings - Fork 3
Families
Family is a subset of units (or a subset of scales) that can be converted to each other e.g. Meter and Centimeter units, as combined by the conversion relationship below, form a family:
unit Centimeter "cm" = 100 * Meter;
Internally family is implemented as an integer number (family id) automatically assigned to each unit when generating units/scales. Units/scales belonging to a family have assigned the same family id and implement conversion operator(s) within the family.
Family relationship is transitive: in the example below Centimeter and Inch belong to the same family because they both belong to Meter family (even though there is no explicit conversion formula combining Centimeter and Inch):
unit Centimeter "cm" = 100 * Meter;
unit Inch "in" = 100 * Meter / 2.54;
Note that families are based on your definitions which might not conform to general engineering conventions. In the example below Centimeter is not included into the common family of Meter and Inch i.e. it cannot be converted to/from Meter or Inch, and this might be surprising:
unit Centimeter "cm" = 100 * <Length>;
unit Inch "in" = 100 * Meter / 2.54;
Note also that all units in a family have the same dimension but the reverse statement might not be true i.e. units of the same dimension might belong to disjoint families e.g. energy and torque. In case of units, it is only the conversion relationship that is deciding about family membership. In case of scales, family membership is determined by a reference point name that is common to all scales in the family.