Package

io.github.karols.units

defining

Permalink

package defining

Package containing helper types and methods for defining new units and ratios between units.

It also contains a set of type-level characters, used for defining type-level unit identifiers.

Usage:

import io.github.karols.units.defining._

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. defining
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. type DefineAffineSpace[Z, U <: MUnit] = internal.AffineSpaces.DefineAffineSpace[Z, U]

    Permalink

    Defines a 1-dimensional affine space using given unit and starting at given zero point.

  2. type DefineUnit[S <: TString] = ^[ASingleUnit[S], P1]

    Permalink

    Defines a unit of measure identified by given type-level string.

  3. class DoubleAScalingTranslation[A <: AffineSpace, B <: AffineSpace] extends ReversibleDoubleAConversion[A, B]

    Permalink

    A two-way conversion between affine spaces with different underlying units.

    A two-way conversion between affine spaces with different underlying units. scale is the conversion between the units. vector is the distance between the zeroes of the space B and scaled space A. Instances of this class should be implicit.

  4. class DoubleATranslation[A <: AffineSpace, B <: AffineSpace] extends ReversibleDoubleAConversion[A, B]

    Permalink

    A two-way conversion between affine spaces with the same underlying units.

    A two-way conversion between affine spaces with the same underlying units. vector is the distance between the zeroes of the spaces. Instances of this class should be implicit.

  5. class DoubleATranslationScaling[A <: AffineSpace, B <: AffineSpace] extends ReversibleDoubleAConversion[A, B]

    Permalink

    A two-way conversion between affine spaces with different underlying units.

    A two-way conversion between affine spaces with different underlying units. scale is the conversion between the units. vector is the distance between the zeroes of the space B and scaled space A. Instances of this class should be implicit.

  6. class DoubleATwoValues[A <: AffineSpace, B <: AffineSpace] extends ReversibleDoubleAConversion[A, B]

    Permalink

    A two-way linears conversion between affine spaces.

    A two-way linears conversion between affine spaces. a1 and b1 are the same value on different scales. a2 and b2 are the same value on different scales. Requires a1 != a2 and b1 != b2 Instances of this class should be implicit.

  7. class IntATranslation[A <: AffineSpace, B <: AffineSpace] extends ReversibleDoubleAConversion[A, B] with ReversibleIntAConversion[A, B]

    Permalink

    A two-way conversion between affine spaces with the same underlying units.

    A two-way conversion between affine spaces with the same underlying units. vector is the distance between the zeroes of the spaces. Instances of this class should be implicit.

  8. sealed trait ReversibleDoubleAConversion[A <: AffineSpace, B <: AffineSpace] extends AnyRef

    Permalink
  9. sealed trait ReversibleIntAConversion[A <: AffineSpace, B <: AffineSpace] extends AnyRef

    Permalink
  10. type _A = AChar[TZ5_0, TZ5_0, TZ5_1]

    Permalink
  11. type _AA = AChar[TZ5_2, TZ5_0, TZ5_4]

    Permalink

    angström sign (Å)

  12. type _B = AChar[TZ5_0, TZ5_0, TZ5_2]

    Permalink
  13. type _C = AChar[TZ5_0, TZ5_0, TZ5_3]

    Permalink
  14. type _D = AChar[TZ5_0, TZ5_0, TZ5_4]

    Permalink
  15. type _DOLLAR = AChar[TZ5_2, TZ5_2, TZ5_2]

    Permalink

    dollar sign ($)

  16. type _DONG = AChar[TZ5_2, TZ5_3, TZ5_3]

    Permalink

    dong sign (₫)

  17. type _E = AChar[TZ5_0, TZ5_1, TZ5_0]

    Permalink
  18. type _EURO = AChar[TZ5_2, TZ5_2, TZ5_3]

    Permalink

    euro sign (€)

  19. type _F = AChar[TZ5_0, TZ5_1, TZ5_1]

    Permalink
  20. type _G = AChar[TZ5_0, TZ5_1, TZ5_2]

    Permalink
  21. type _H = AChar[TZ5_0, TZ5_1, TZ5_3]

    Permalink
  22. type _I = AChar[TZ5_0, TZ5_1, TZ5_4]

    Permalink
  23. type _J = AChar[TZ5_0, TZ5_2, TZ5_0]

    Permalink
  24. type _K = AChar[TZ5_0, TZ5_2, TZ5_1]

    Permalink
  25. type _L = AChar[TZ5_0, TZ5_2, TZ5_2]

    Permalink
  26. type _M = AChar[TZ5_0, TZ5_2, TZ5_3]

    Permalink
  27. type _N = AChar[TZ5_0, TZ5_2, TZ5_4]

    Permalink
  28. type _O = AChar[TZ5_0, TZ5_3, TZ5_0]

    Permalink
  29. type _OMEGA = AChar[TZ5_2, TZ5_1, TZ5_1]

    Permalink

    ohm sign (Ω)

  30. type _P = AChar[TZ5_0, TZ5_3, TZ5_1]

    Permalink
  31. type _POUND = AChar[TZ5_2, TZ5_2, TZ5_0]

    Permalink

    pound sign (£)

  32. type _Q = AChar[TZ5_0, TZ5_3, TZ5_2]

    Permalink
  33. type _R = AChar[TZ5_0, TZ5_3, TZ5_3]

    Permalink
  34. type _RUPEE = AChar[TZ5_2, TZ5_3, TZ5_4]

    Permalink

    rupee sign (₨)

  35. type _S = AChar[TZ5_0, TZ5_3, TZ5_4]

    Permalink
  36. type _T = AChar[TZ5_0, TZ5_4, TZ5_0]

    Permalink
  37. type _U = AChar[TZ5_0, TZ5_4, TZ5_1]

    Permalink
  38. type _V = AChar[TZ5_0, TZ5_4, TZ5_2]

    Permalink
  39. type _W = AChar[TZ5_0, TZ5_4, TZ5_3]

    Permalink
  40. type _X = AChar[TZ5_0, TZ5_4, TZ5_4]

    Permalink
  41. type _Y = AChar[TZ5_1, TZ5_0, TZ5_0]

    Permalink
  42. type _YEN = AChar[TZ5_2, TZ5_2, TZ5_1]

    Permalink

    yen sign (¥)

  43. type _Z = AChar[TZ5_1, TZ5_0, TZ5_1]

    Permalink
  44. type _a = AChar[TZ5_1, TZ5_0, TZ5_3]

    Permalink
  45. type _at = AChar[TZ5_0, TZ5_0, TZ5_0]

    Permalink

    commercial at sign (@)

  46. type _b = AChar[TZ5_1, TZ5_0, TZ5_4]

    Permalink
  47. type _bis = AChar[TZ5_2, TZ5_3, TZ5_2]

    Permalink

    a synonym for angular second sign _sec (ʺ)

  48. type _c = AChar[TZ5_1, TZ5_1, TZ5_0]

    Permalink
  49. type _d = AChar[TZ5_1, TZ5_1, TZ5_1]

    Permalink
  50. type _deg = AChar[TZ5_2, TZ5_3, TZ5_0]

    Permalink

    degree sign (°)

  51. type _digit_1 = AChar[TZ5_3, TZ5_3, TZ5_1]

    Permalink

    digit 1 (₅)

  52. type _dot = AChar[TZ5_2, TZ5_4, TZ5_2]

    Permalink

    center dot (·)

  53. type _e = AChar[TZ5_1, TZ5_1, TZ5_2]

    Permalink
  54. type _e_acute = AChar[TZ5_2, TZ5_1, TZ5_4]

    Permalink

    e with acute accent (é)

  55. type _epsilon = AChar[TZ5_2, TZ5_1, TZ5_2]

    Permalink

    epsilon (ε)

  56. type _f = AChar[TZ5_1, TZ5_1, TZ5_3]

    Permalink
  57. type _foot = AChar[TZ5_2, TZ5_3, TZ5_1]

    Permalink

    a synonym for angular minute sign _min (ʹ)

  58. type _g = AChar[TZ5_1, TZ5_1, TZ5_4]

    Permalink
  59. type _h = AChar[TZ5_1, TZ5_2, TZ5_0]

    Permalink
  60. type _i = AChar[TZ5_1, TZ5_2, TZ5_1]

    Permalink
  61. type _inch = AChar[TZ5_2, TZ5_3, TZ5_2]

    Permalink

    a synonym for angular second sign _sec (ʺ)

  62. type _j = AChar[TZ5_1, TZ5_2, TZ5_2]

    Permalink
  63. type _k = AChar[TZ5_1, TZ5_2, TZ5_3]

    Permalink
  64. type _l = AChar[TZ5_1, TZ5_2, TZ5_4]

    Permalink
  65. type _l_ = AChar[TZ5_2, TZ5_2, TZ5_4]

    Permalink

    lowercase L with stroke (ł)

  66. type _left_paren = AChar[TZ5_3, TZ5_1, TZ5_3]

    Permalink

    left parenthesis

  67. type _m = AChar[TZ5_1, TZ5_3, TZ5_0]

    Permalink
  68. type _min = AChar[TZ5_2, TZ5_3, TZ5_1]

    Permalink

    angular minute sign (ʹ)

  69. type _mu = AChar[TZ5_2, TZ5_1, TZ5_0]

    Permalink

    micro sign (µ)

  70. type _n = AChar[TZ5_1, TZ5_3, TZ5_1]

    Permalink
  71. type _o = AChar[TZ5_1, TZ5_3, TZ5_2]

    Permalink
  72. type _p = AChar[TZ5_1, TZ5_3, TZ5_3]

    Permalink
  73. type _percent = AChar[TZ5_2, TZ5_4, TZ5_0]

    Permalink

    percent sign (%)

  74. type _period = AChar[TZ5_2, TZ5_4, TZ5_3]

    Permalink

    full stop / period (.)

  75. type _permille = AChar[TZ5_2, TZ5_4, TZ5_1]

    Permalink

    permille sign (‰)

  76. type _prime = AChar[TZ5_2, TZ5_3, TZ5_1]

    Permalink

    a synonym for angular minute sign _min (ʹ)

  77. type _q = AChar[TZ5_1, TZ5_3, TZ5_4]

    Permalink
  78. type _r = AChar[TZ5_1, TZ5_4, TZ5_0]

    Permalink
  79. type _right_paren = AChar[TZ5_3, TZ5_1, TZ5_4]

    Permalink

    right parenthesis

  80. type _s = AChar[TZ5_1, TZ5_4, TZ5_1]

    Permalink
  81. type _sec = AChar[TZ5_2, TZ5_3, TZ5_2]

    Permalink

    angular second sign (ʺ)

  82. type _space = AChar[TZ5_2, TZ5_4, TZ5_4]

    Permalink

    space

  83. type _sub_0 = AChar[TZ5_3, TZ5_0, TZ5_0]

    Permalink

    subscript zero (₀₅)

  84. type _sub_2 = AChar[TZ5_3, TZ5_0, TZ5_1]

    Permalink

    subscript two (₂)

  85. type _sub_3 = AChar[TZ5_3, TZ5_0, TZ5_2]

    Permalink

    subscript three (₃)

  86. type _sub_4 = AChar[TZ5_3, TZ5_0, TZ5_3]

    Permalink

    subscript four (₄)

  87. type _sub_5 = AChar[TZ5_3, TZ5_0, TZ5_4]

    Permalink

    subscript five (₅)

  88. type _sub_e = AChar[TZ5_3, TZ5_2, TZ5_0]

    Permalink

    subscript e (₅)

  89. type _sub_h = AChar[TZ5_3, TZ5_2, TZ5_1]

    Permalink

    subscript h (₅)

  90. type _sub_m = AChar[TZ5_3, TZ5_1, TZ5_0]

    Permalink

    subscript m (₅)

  91. type _sub_n = AChar[TZ5_3, TZ5_1, TZ5_1]

    Permalink

    subscript n (₅)

  92. type _sub_p = AChar[TZ5_3, TZ5_2, TZ5_2]

    Permalink

    subscript p (₅)

  93. type _sub_s = AChar[TZ5_3, TZ5_2, TZ5_3]

    Permalink

    subscript s (₅)

  94. type _sub_t = AChar[TZ5_3, TZ5_2, TZ5_4]

    Permalink

    subscript t (₅)

  95. type _t = AChar[TZ5_1, TZ5_4, TZ5_2]

    Permalink
  96. type _u = AChar[TZ5_1, TZ5_4, TZ5_3]

    Permalink
  97. type _v = AChar[TZ5_1, TZ5_4, TZ5_4]

    Permalink
  98. type _w = AChar[TZ5_2, TZ5_0, TZ5_0]

    Permalink
  99. type _x = AChar[TZ5_2, TZ5_0, TZ5_1]

    Permalink
  100. type _y = AChar[TZ5_2, TZ5_0, TZ5_2]

    Permalink
  101. type _z = AChar[TZ5_2, TZ5_0, TZ5_3]

    Permalink
  102. type ~:[H <: TChar, T <: TString] = internal.Strings.~:[H, T]

    Permalink

    String constructor.

    String constructor. Separate type-level characters with ~: to create a type-level string.

Value Members

  1. def alias[F <: MUnit, T <: MUnit]: UnitAlias[F, T]

    Permalink
    Annotations
    @inline()
  2. def convertAffineSpace[T1 <: AffineSpace, T2 <: AffineSpace](f: (Double) ⇒ Double): internal.ratios.DoubleAffineSpaceConverter[T1, T2]

    Permalink

    Creates a one-way affine space converter.

    Creates a one-way affine space converter. You should store it in an implicit val.

    Annotations
    @inline()
  3. def convertIntAffineSpace[T1 <: AffineSpace, T2 <: AffineSpace](f: (Long) ⇒ Long): internal.ratios.IntAffineSpaceConverter[T1, T2]

    Permalink

    Creates a one-way integer affine space converter.

    Creates a one-way integer affine space converter. You should store it in an implicit val.

    Annotations
    @inline()
  4. def matchingAffineSpacePoint[A <: AffineSpace, B <: AffineSpace](xA: DoubleA[A], xB: DoubleA[B])(implicit ev: =:=[defining.matchingAffineSpacePoint.A.Unit, defining.matchingAffineSpacePoint.B.Unit]): DoubleATranslation[A, B]

    Permalink

    Creates a two-way affine space converter, based on one points defined in two affine spaces.

    Creates a two-way affine space converter, based on one points defined in two affine spaces. The affine spaces should have the same base unit. This defines a translation – a conversion that simply shifts values by a constant displacement. You should store it in an implicit val.

    Annotations
    @inline()
  5. def matchingAffineSpacePoints[A <: AffineSpace, B <: AffineSpace](xA: DoubleA[A], xB: DoubleA[B], yA: DoubleA[A], yB: DoubleA[B]): DoubleATwoValues[A, B]

    Permalink

    Creates a two-way affine space converter, based on two points x and y defined in two affine spaces.

    Creates a two-way affine space converter, based on two points x and y defined in two affine spaces. You should store it in an implicit val.

    Annotations
    @inline()
  6. def one[U <: MUnit]: OneBuilder[U]

    Permalink

    Helper for defining unit ratios.

    Helper for defining unit ratios. Syntax: one[kilometre].contains(1000)[metre]

    Annotations
    @inline()
  7. def product[F1 <: MUnit, F2 <: MUnit, T1 <: MUnit, T2 <: MUnit](implicit r1: internal.ratios.DoubleRatio[F1, T2], r2: internal.ratios.DoubleRatio[F2, T2]): BaseDoubleRatio[defining.product.F1.Mul[F2], defining.product.T1.Mul[T2]]

    Permalink
    Annotations
    @inline()
  8. def productInt[F1 <: MUnit, F2 <: MUnit, T1 <: MUnit, T2 <: MUnit](implicit r1: BaseIntRatio[F1, T2], r2: BaseIntRatio[F2, T2]): BaseIntRatio[defining.productInt.F1.Mul[F2], defining.productInt.T2.Mul[T2]]

    Permalink
    Annotations
    @inline()

Inherited from AnyRef

Inherited from Any

Ungrouped