# H3DU.BezierSurface

### H3DU.BezierSurface(cp, [u1], [u2], [v1], [v2])

**Augments:** H3DU.Surface

**Deprecated: Instead of this class, use H3DU.BSplineSurface.fromBezierSurface
to create a Bézier surface.**

A surface evaluator object for a Bézier surface.

#### Parameters

`cp`

(Type: Array.<Array.<Array.<number>>>)

An array of control point arrays as specified in H3DU.BSplineSurface.fromBezierSurface.`u1`

(Type: number) (optional)

No longer used since version 2.0. The starting and ending points will be (0, 0). (This parameter was the starting point for the purpose of interpolation along the U axis.)`u2`

(Type: number) (optional)

No longer used since version 2.0. The starting and ending points will be (0, 0). (This parameter was the ending point for the purpose of interpolation along the U axis.)`v1`

(Type: number) (optional)

No longer used since version 2.0. The starting and ending points will be (0, 0). (This parameter was the starting point for the purpose of interpolation along the V axis.)`v2`

(Type: number) (optional)

No longer used since version 2.0. The starting and ending points will be (0, 0). (This parameter was the ending point for the purpose of interpolation along the V axis.)

### Methods

- bitangent

Finds an approximate bitangent vector of this surface at the given U and V coordinates. - endPoints

Returns the starting and ending U and V coordinates of this surface. - evaluate

Evaluates the surface function based on a point in a Bézier surface. - gradient

Finds an approximate gradient vector of this surface at the given U and V coordinates. - normal

Convenience method for finding an approximate normal vector of this surface at the given U and V coordinates. - tangent

Finds an approximate tangent vector of this surface at the given U and V coordinates.

### H3DU.BezierSurface#bitangent(u, v)

Finds an approximate bitangent vector of this surface at the given U and V coordinates.

The implementation in H3DU.Surface calls the evaluator's `bitangent`

method if it implements it; otherwise, does a numerical differentiation
with respect to the V axis using the `evaluate`

method.

The **bitangent vector** is the vector pointing in the direction of the V axis, or alternatively,
the partial derivative of the `evaluate`

method with respect to `v`

. The bitangent vector returned by this method *should not* be "normalized" to a unit vector.

#### Parameters

`u`

(Type: number)

U coordinate of a point on the surface.`v`

(Type: number)

V coordinate of a point on the surface.

#### Return Value

An array describing a bitangent vector. It should have at least as many elements as the number of dimensions of the underlying surface. (Type: Array.<number>)

### H3DU.BezierSurface#endPoints()

Returns the starting and ending U and V coordinates of this surface.

#### Return Value

A four-element array. The first and second elements are the starting and ending U coordinates, respectively, of the surface, and the third and fourth elements are its starting and ending V coordinates. (Type: Array.<number>)

### H3DU.BezierSurface#evaluate(u, v)

Evaluates the surface function based on a point in a Bézier surface.

#### Parameters

`u`

(Type: number)

U coordinate of the surface to evaluate (generally within the range given in the constructor).`v`

(Type: number)

V coordinate of the surface to evaluate.

#### Return Value

An array of the result of the evaluation. It will have as many elements as a control point, as specified in the constructor. (Type: Array.<number>)

### H3DU.BezierSurface#gradient(u, v)

Finds an approximate gradient vector of this surface at the given U and V coordinates.

The implementation in H3DU.Surface calls the evaluator's `gradient`

method if it implements it; otherwise uses the surface's tangent and bitangent vectors to implement the gradient
(however, this approach is generally only meaningful for a three-dimensional surface).

The **gradient** is a vector pointing up and away from the surface.
If the evaluator describes a regular three-dimensional surface (usually
a continuous, unbroken surface such as a sphere, an open
cylinder, or a disk rotated in three dimensions), this can be the cross product
of the tangent vector
and bitangent vector,
in that order. The gradient returned by this method *should not* be "normalized" to a unit vector.

#### Parameters

`u`

(Type: number)

U coordinate of a point on the surface.`v`

(Type: number)

V coordinate of a point on the surface.

#### Return Value

An array describing a gradient vector. It should have at least as many elements as the number of dimensions of the underlying surface. (Type: Array.<number>)

### H3DU.BezierSurface#normal(u, v)

Convenience method for finding an approximate normal vector of this surface at the given U and V coordinates.
The **normal vector** is the same as the gradient vector, but "normalized" to a unit vector.

#### Parameters

`u`

(Type: number)

U coordinate of a point on the surface.`v`

(Type: number)

V coordinate of a point on the surface.

#### Return Value

An array describing a normal vector. It should have at least as many elements as the number of dimensions of the underlying surface. (Type: Array.<number>)

### H3DU.BezierSurface#tangent(u, v)

Finds an approximate tangent vector of this surface at the given U and V coordinates.
The implementation in H3DU.Surface calls the evaluator's `tangent`

method if it implements it; otherwise, does a numerical differentiation
with respect to the U axis using the `evaluate`

method.

The **tangent vector** is the vector pointing in the direction of the U axis,
or alternatively, the partial derivative of the `evaluate`

method with respect to `u`

.
The tangent vector returned by this method *should not* be "normalized" to a unit vector.

#### Parameters

`u`

(Type: number)

U coordinate of a point on the surface.`v`

(Type: number)

V coordinate of a point on the surface.

#### Return Value

An array describing a tangent vector. It should have at least as many elements as the number of dimensions of the underlying surface. (Type: Array.<number>)