4.5 Constants

Constants are values that stay static when time changes. A simple number like 5 is a constant. Constants can be used as multiplicators or to offset values. You can manually define a constant, e.g.

my_constant = 3.98;

From this statement on you can use my_constant as a static value in your statements. Constants can have different data types like floating point, vector or string. If you want to compile your expression you need to initialize the contant:

double my_constant = 3.98;

Refer also to the Compile section of this manual how to define a data type for a constant if you want to compile your expression.

To avoid having you define common constants like pi and the like every time you want to use that value in an expression, you can simply type pi and Xpressionist will automatically assign the value into your expression. All constants available in Xpressionist are listed below.

Since the syntax of Xpressionist is very open in normal mode you can also type

pi = 2;

In this case you have assigned pi a new value. From this statement on Xpressionist will assign the value 2 whenever pi is used in one of the following expressions.

Note: Never give a predefined constant a new value as in the above example if you work in compile mode.

Xpressionist provides you with various constants which will be colored red with bold letters if you use them in your script. Here is a list of all available constants in Xpressionist:

category

name of constant

numeric value

units

math



project




length





weight/volume





speed



astronomy













atmosphere







energy






electro magnetism


molecular/chemical

pi
golden_ratio
eulers_const

fps
childgroups
totalframes
starttime

cm_per_in
ft_per_m
km_per_mi
acres_per_sq_km
deg_per_rad

gm_per_oz
lbs_per_kg
kg_per_slug
oz_per_gal
lit_per_gal

speed_of_sound
speed_of_light
knots_per_mph

earth_esc_spd
earth_grav
earth_mass
earth_radius
earth_to_moon
earth_to_sun
moon_grav
moon_mass
moon_period
moon_radius
sun_mass
sun_radius
solar_const

air_density
air_mol_mass
gas_const
atm_per_psi
pasc_per_atm
pasc_per_psi
pasc_per_torr

watts_per_hp
joule_per_btu
joule_per_cal
joule_per_ftlb
joule_per_kwh
erg_per_joule

gauss_per_tesla
coulomb_const

boltzmann
avogadro
zero_deg_cels

3.14159265358979323846
1.6180339887498948482
0.57721566490153286061

current fps setting of the project
number of childgroups
total number of frames
the start time of the project

2.54
3.280839895
1.609344
247.1
57.2958

28.34952313
2.204622622
14.59
128
3.785411784

340.292 (at sealevel)
2.997925e8
0.86897624

1.12e4
9.80665
5.98e24
6.37e6
3.844e8
1.496e11
1.62
7.35e22
2360448
1.738e6
199e30
6.96e8
1350

1.225 (at earth surface)
0.02897
8.31447
0.06804
101325
6895
133.32

745.721
1054.35
4.184
1.356
3.6e6
1e7

1e4
8.98755e9

1.3807e-23
6.0220e23
273.15










centimeter / inch
foot / meter
kilometer / mile
acre / kilometer^2
degree / radian

gram / ounce
pounds / kilogram
kilogram / slug
ounce / gallon
litre / gallon

meter / second
meter / second
knots / mile / hour

meter / second
meter / second / second
kilograms
kilometer
kilometer
kilometer
meter^2 / kilogram^2
kilogram
seconds
kilometers
kilogram
kilometers
watt / meter^2

kilogram / meter^3

joule / (kelvin mole)
atmosphere / (pound / inch^2)
pascal / atmosphere
pascal / (pound / inch^2)
pascal / torr

watt / horsepower
joul / btu (british thermal unit)
joule / calorie
joule / foot * pound
joule / kilowatt * hour
erg / joule




joule / kelvin
1 / mole
degree Angstrom

Xpressionist 3.5