Units Module
Last updated
Last updated
Units in Warp Factory use functions that scale all values from S.I. units. These functions are called without pass-in values, and thus can also ignore the ().
These functions should be treated as reserved variables, make sure to avoid overlap in variable declarations to use these units properly.
For example, to set the unit scaling for some variable called value
, which is implicitly defined in meters, we can say:
value = 1*mm()
or value = 1*mm
This scales the value of 1 to mm, which would then be 0.001. This can also be used in the code to define what the units are explicitly in the code structure, such as calling meter
which is unitary.
The list of implemented unit scaling functions are:
tonne
second
ms
mm
meter
km
kg
gram
cm
In addition, a few universal constants are used in the same manner as unit scaling. These are:
G: Gravitational Constant - [m/s]
c: Speed of Light - [m^3 / kg / s^2]