Formula
方程式
常规
You can type in a formula for the Formula spline primitive and the Formula deformer. In fact, you can type in a formula wherever Cinema 4D accepts a value, e.g., in the Attribute Manager. This appendix lists all the units, operators, functions and constants that you may use in your formulae. You may enter values using any of the units listed below (examples in brackets) - regardless of the basic units defined in the preferences (Cinema 4D will convert the units for you).
您可以键入公式样条基元和公式分解器的公式。事实上,你可以在 Cinema 4D 接受一个值的地方输入一个公式,例如,在 Attribute Manager 中。这个附录列出了所有的单位,运算符,函数和常量,你可以在你的公式中使用。您可以使用下面列出的任何单位(括号中的例子)输入值——不管在首选项中定义的基本单位(Cinema 4D 将为您转换单位)。
Arguments such as mod(a;b) must be separated by a semi-colon or by squared brackets [] (then without curved brackets)
诸如 mod (a; b)之类的参数必须用分号或方括号[]分隔(然后去掉曲括号)
rnd(100) is the same as rnd[100] and rnd(100;234) is the same as rnd([100][234]).
Rnd (100)等于 rnd [100] ,rnd (100; 234)等于 rnd ([100][234])。
Note the special variables in association with multiple selections in the following paragraph.
请注意下面段落中与多重选择相关的特殊变量。
Expanded Formula Entry by Multiple Selections
多重选择扩展公式输入
You can also make relative adjustments to multiple selected objects. For example, suppose a sphere is positioned at (100,0,0) and a cube at (300,0,0). Select both objects and in the Attribute Manager, on the Coord tab, enter x + 100 into the P.X box. Both objects will be moved 100 units along the X axis. You can also enter equations, such as sin(x)+sqr(x*324).
您还可以对多个选定对象进行相对调整。例如,假设一个球体位于(100,0,0) ,一个立方体位于(300,0,0)。选择这两个对象,在属性管理器中,在 Coord 选项卡上,在 P.X 框中输入 x + 100。两个对象将沿 x 轴移动100个单位。您还可以输入等式,比如 sin (x) + sqr (x * 324)。
The following variables are available:
以下变量是可用的:
x: Represents the parameter’s original value
X: 表示参数的原始值
num: Represents the index value. The selected elements/objects will be numbered
Num: 表示索引值。选定的元素/对象将被编号
tot: The total number of selected elements/objects
Tot: 选定元素/对象的总数
rnd(value): A random value between 0 and "value" will be ascertained
Rnd (值) : 将确定介于0和“值”之间的一个随机值
例子
单位
A custom value can be entered, independently of any preset values.
可以独立于任何预设值输入自定义值。
Tip: 提示:功能
Tip: 提示: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°.
三角函数的论点总是被解释为程度。因此,条目 sin (2 * pi)不反映360 ° 正弦的计算,而是反映大约6.283 ° 正弦的计算。
常规
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).
函数解析器内置了最重要的算术运算符。您可以自由地组合操作,例如: 2 km + exp (sin (4mm * pi))/(sin (14cm)) ^ 2 + (cos (14cm)) ^ 2)。