CurveGenerator

MLModule
genre Diagram
authors Tobias Block, Bernd Merkel
package FMEstable/ReleaseMeVis
dll MLCurveUtils
definition MLCurveUtils.def
see also CurveFilter, SoDiagram2D, CurveImport
keywords curve, diagram, generator, base, parser

Purpose

The module CurveGenerator generates an output Curve given a function expression that describes the curve.

Usage

Give the function expression in the f(x) section, change constants if necessary and use SoDiagram2D to see the result curve.

Details

Internally the muparser (v 2.2.3) is used: http://muparser.beltoforion.de/

Functions

Name Num. Args Explanation
sin 1 sine function
sin 1 sine function
cos 1 cosine function
tan 1 tangens function
asin 1 arcus sine function
acos 1 arcus cosine function
atan 1 arcus tangens function
sinh 1 hyperbolic sine function
cosh 1 hyperbolic cosine
tanh 1 hyperbolic tangens function
asinh 1 hyperbolic arcus sine function
acosh 1 hyperbolic arcus tangens function
atanh 1 hyperbolic arcur tangens function
log2 1 logarithm to the base 2
log10 1 logarithm to the base 10
log 1 logarithm to the base 10
ln 1 logarithm to base e (2.71828…)
exp 1 e raised to the power of x
sqrt 1 square root of a value
sign 1 sign function -1 if x<0; 1 if x>0
rint 1 round to nearest integer
abs 1 absolute value
min var. min of all arguments
max var. max of all arguments
sum var. sum of all arguments
avg var. mean value of all arguments

Operators

Operator Description Priority
= assignement -1
&& logical and 1
|| logical or 2
<= less or equal 4
>= greater or equal 4
!= not equal 4
== equal 4
> greater than 4
< less than 4
+ addition 5
- subtraction 5
* multiplication 6
/ division 6
^ raise x to the power of y 7
Operator Description Remarks
?: if then else operator C++ style syntax

Constants

Constant Description
e, _e Euler number
log2e log2(e)
log10e log10(e)
ln2 ln(2)
ln10 ln(10)
pi, _pi Pi
half_pi Pi * 0.5

Windows

Default Panel

../../../Projects/MLCurveUtils/Modules/mhelp/Images/Screenshots/CurveGenerator._default.png

Output Fields

outCurve

name: outCurve, type: MLBase

Output of curve representing the expression

Parameter Fields

Field Index

= (extValueA): Double End: Double Ext Name G: String
= (extValueB): Double Error:: String Ext Name H: String
= (extValueC): Double Expression Comment: String f(x) =: String
= (extValueD): Double Ext Name A: String Name: String
= (extValueE): Double Ext Name B: String Number of Constants: Integer
= (extValueF): Double Ext Name C: String Number of Points: Integer
= (extValueG): Double Ext Name D: String Start: Double
= (extValueH): Double Ext Name E: String Step: Double
Edit Constant Names: Bool Ext Name F: String Style: Integer

Visible Fields

f(x) =

name: expression, type: String, default: x^2+2*x

Sets a string that describes the mathematical expression of the curve.

Start

name: startValue, type: Double, default: 0

Sets the start value of the definition range.

End

name: endValue, type: Double, default: 1

Sets the end value of the definition range.

Step

name: stepValue, type: Double, default: 0.1, minimum: 0.01

Sets a step value in x-direction for function evaluation.

Error:

name: errorText, type: String

Shows an error message if the expression string could not be parsed correctly.

= (extValueA)

name: extValueA, type: Double, default: 0

Value of 1. constant used in function.

= (extValueB)

name: extValueB, type: Double, default: 0

Value of 2. constant used in function.

= (extValueC)

name: extValueC, type: Double, default: 0

Value of 3. constant used in function.

= (extValueD)

name: extValueD, type: Double, default: 0

Value of 4. constant used in function.

= (extValueE)

name: extValueE, type: Double, default: 0

Value of 5. constant used in function.

= (extValueF)

name: extValueF, type: Double, default: 0

Value of 6. constant used in function.

= (extValueG)

name: extValueG, type: Double, default: 0

Value of 7. constant used in function.

= (extValueH)

name: extValueH, type: Double, default: 0

Value of 8. constant used in function.

Ext Name A

name: extNameA, type: String, default: a

Name of 1. constant used in function.

Ext Name B

name: extNameB, type: String, default: b

Name of 2. constant used in function.

Ext Name C

name: extNameC, type: String, default: c

Name of 3. constant used in function.

Ext Name D

name: extNameD, type: String, default: d

Name of 4. constant used in function.

Ext Name E

name: extNameE, type: String, default: e

Name of 5. constant used in function.

Ext Name F

name: extNameF, type: String, default: f

Name of 6. constant used in function.

Ext Name G

name: extNameG, type: String, default: g

Name of 7. constant used in function.

Ext Name H

name: extNameH, type: String, default: h

Name of 8. constant used in function.

Style

name: style, type: Integer, default: 1, minimum: 1

Sets the style of the output curve.

Number of Points

name: pointCount, type: Integer, default: 11

Shows the number of curve points.

Name

name: curveName, type: String

Sets a name for the curve.

Expression Comment

name: expressionComment, type: String

Comment your expression

Number of Constants

name: numberOfShownConstants, type: Integer, default: 4, minimum: 0, maximum: 8

Number of show constants

Edit Constant Names

name: editConstantNames, type: Bool, default: FALSE

If true, constant names can be changed