# `class wmutil.CubicCurve`

Available on all platforms

Catmull-Rom method to draw smooth curve

See http://www.t-pot.com/program/2_3rdcurve/index.html for detail. (written in japanese)

General formula of smooth curve from x0 to x_(n+1) through x1 ... xn is x(t) = a * t^3 + b * t^2 +c * t + d.

## Instance Fields

### `var cf0:Point3D`

constant cf0 of a cubic curve x(t) = cf0 + cf1t + cf2t^2 + cf3 * t^3

### `var cf1:Point3D`

coefficient cf1 of a cubic curve x(t) = cf0 + cf1t + cf2t^2 + cf3 * t^3

### `var cf2:Point3D`

coefficient cf2 of a cubic curve x(t) = cf0 + cf1t + cf2t^2 + cf3 * t^3

### `var cf3:Point3D`

coefficient cf3 of a cubic curve x(t) = cf0 + cf1t + cf2t^2 + cf3 * t^3

### `function new(p0:Point3D, p1:Point3D, p2:Point3D, p3:Point3D):Void`

Constructor. If positions are given, Catmull-Rom curve associated with those points will be generated. See also generate() function.

### `function clear():Void`

reset all data

### `function generate(p0:Point3D, p1:Point3D, p2:Point3D, p3:Point3D):CubicCurve`

generate Catmull-Rom curve. First OR last argument can be null, it is necessary in drawing curves on terminals. The return value is the `this` instance itself.

### `function getVal(num:Float):Point3D`

returns the position x(num) in the curve, where x(num) = cf0 + cf1(num) + cf2(num)^2 + cf3 * (num)^3.

### `function get_cf0():Point3D`

getter of `cf0`

### `function get_cf1():Point3D`

getter of `cf1`

### `function get_cf2():Point3D`

getter of `cf2`

### `function get_cf3():Point3D`

getter of `cf3`

### `function set_cf0(c:Point3D):Point3D`

setter of `cf0`

### `function set_cf1(c:Point3D):Point3D`

setter of `cf1`

### `function set_cf2(c:Point3D):Point3D`

setter of `cf2`

### `function set_cf3(c:Point3D):Point3D`

setter of `cf3`

### `function toString():String`

returns coefficients as a string