## Detailed Look into Mograph Formula Effector

This post has already been read 7684 times!

Detailed look into mograph formula effector and formula appendix for writing your own formulas…

**Practice**

*(We will create a example scene in order to test our formulas)*

Create a cloner and feed it with a plane or poly object. Add formula effector. Your cloner mode would be Object in this example. Create a sphere an drag this object to cloner’s object field. Set distribution as Polygon Center. Now it’s time to set our formula.

On **formula** – **effector** tab you’ll find an input text area titled as **Formula**. We would write any kind of **formulas** using **Cinema 4D’s formula appendix**.

In this example we have used clamp(0;1;(id<=t) * (t-id*f))

*You may download sample scene below;*

**Xpresso Cloner Time Offset with Formula 75.05 KB**

By default it’s explained several appendix usage under formula effector.

- px,py,pz – Position
- rx,ry,rz – Rotation
- sx,sy,sz – Scale
- id – Object Index
- count – Object Count
- falloff – Falloff weight

And also notice that we have one t and f values. **T** represents** Time value** and **F** represents **Frequency** which we might use in our **formula** string. If you use it **Formula Node** in **Xpresso** you would have a chance to add your custom inputs and read those values but in this example we will only use **Formula Effector** and a **Cloner**. So let’s look at **formula appendix** in depth according to **Maxon Cinema 4D Formula Appendix Reference**.

## Maxon Cinema 4D Formula Appendix Reference

**Mathematical Operators**

+Addition

– Subtraction

* Multiplication

/ Division

( Left Parenthesis

) Right Parenthesis

**Units**

km Kilometer

m Meter

cm Centimeter

mm Milimeter

um Micrometer

nm Nanometer

mi Mile

yd Yard

ft Foot

in Inch

B Frame Number

**Functions**

sin(a) Sinus

cos(a) Cosinus

acos(a) Arcus Cosinus

asin(a) Arcus Sinus

tan(a) Tangent

atan(a) Arcus Tangent

cosh(a) Cosinus Hyerbolicus

sinh(a) Sinus Hyerbolicus

tanh(a) Tangent Hyerbolicus

floor(a) Round Down

ceil(a) Round Up

round(a) Round

abs(a) Absolute

sqr(a) Square Exponentiation

sqrt(a) Square Root

exp(a) Expontential Function

log10(a) Logarithm to the base of 10

log(a) Logarithm to the base of e

trunch(a) Truncates a number

rnd(a{;b}) Random between 0 and a, opt.b as seed value

pow(a;b) Exponentiation

mod(a;b) Modulo

clamp(a;b;c) Clamps val. of c btw. a & b

min(a;b) Minimum value a or b

max(a;b) Maximum value a or b

(a)<<(b) Bitwise shift to left

(a)shl(b) Bitwise shift to left

(a)<<(b) Bitwise shift to right

(a)shr(b) Bitwise shift to right

len(a;b{;…}) Vector Length

**Logical Operators**

= Equal Compare

== Equal Compare

> Greater Than

< Less Than

>= Greater than or Equal compare

<= Less than or Equal Compare

!= Not Equal Compare

! Not

|| bzw.or or

&& bzw. and and

& Bitwise And

| Bitwise Or

^ Bitwise Xor

~ Bitwise Not

?(a;b) Condition, If Statemtn: a, then b

**Constants**

e The Constant e ( Euler’s Number) = 2.71828

pi The Constant Pi (Ludolph’s Number) = 3.14159

pi05 Constant of Half of Pi

pi2 Constant of 2* Pi

piinv Constant of inverse Pi

pi05inv Constant of inverse of half of Pi

pi2inv Constant of Inverse of 2*Pi

**Units**

*A custom value can be entered, independently of any preset values.*

*Tip:*

*If you change the basic units in the preferences, e.g., from meters to millimeters, only the measurement units are changed, not existing numerical values. For example, if an object has a width of 10 meters, but you then change the basic units to millimeters, the object will then have a width of 10 millimeters. If you wish to scale the objects to reflect the change in units, group all the objects and scale the group using the Coordinate manager.*

**Functions**

*Tip:*

*Function arguments must be bracketed. The number of open brackets must equal the number of close brackets. Functions may be nested: sin(sqr(exp(pi))).*

*Trigonometric function arguments will always be interpreted as degrees. Hence, the entry sin(2*pi) does not reflect the calculation of a sine of 360° but rather of approx. 6.283°.*

**General**

*When typing in a formula for the spline or Formula time curve, the arguments of trigonometric functions are in radians. However, when entering values in parameter text boxes, trigonometric functions always use degrees.*

*The function parser has the most important arithmetic operators built in. You can combine operations freely, for example: 2km + exp(sin(4mm*pi)) / ((sin(14cm))^2 + (cos(14cm))^2).*