# Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English verison of the page.

# transformPointsForward

Apply forward geometric transformation

## Syntax

``[x, y] = transformPointsForward(tform,u,v)``
``[x, y, z] = transformPointsForward(tform,u,v,w)``
``X = transformPointsForward(tform,U)``

## Description

example

````[x, y] = transformPointsForward(tform,u,v)` applies the forward transformation of 2-D geometric transformation `tform` to the points specified by coordinates `u` and `v`.```
````[x, y, z] = transformPointsForward(tform,u,v,w)` applies the forward transformation of 3-D geometric transformation `tform` to the points specified by coordinates `u`, `v`, and `w`.```
````X = transformPointsForward(tform,U)` applies the forward transformation of `tform` to the input coordinate matrix `U` and returns the coordinate matrix `X`. `transformPointsForward` maps the kth point `U`(k,`:`) to the point `X`(k,`:`).```

## Examples

collapse all

Create an `affine2d` object that defines the transformation.

```theta = 10; tform = affine2d([cosd(theta) -sind(theta) 0; sind(theta) cosd(theta) 0; 0 0 1])```
```tform = affine2d with properties: T: [3x3 double] Dimensionality: 2```

Apply forward geometric transformation to an input (`U`,`V`) point.

`[X,Y] = transformPointsForward(tform,5,10)`
```X = 6.6605 Y = 8.9798```

## Input Arguments

collapse all

Geometric transformation, specified as an `affine2d`, `affine3d`, or `projective2d` geometric transformation object.

x-coordinates of points to be transformed, specified as an m-by-n or m-by-n-by-p numeric array. The number of dimensions of `u` matches the dimensionality of `tform`.

Data Types: `single` | `double`

y-coordinates of points to be transformed, specified as an m-by-n or m-by-n-by-p numeric array. The size of `v` must match the size of `u`.

Data Types: `single` | `double`

z-coordinates of points to be transformed, specified as an m-by-n-by-p numeric array. `w` is used only when `tform` is a 3-D geometric transformation. The size of `w` must match the size of `u`.

Data Types: `single` | `double`

Coordinates of points to be transformed, specified as an l-by-2 or l-by-3 numeric array. The number of columns of `U` matches the dimensionality of `tform`.

The first column lists the x-coordinate of each point to transform, and the second column lists the y-coordinate. If `tform` represents a 3-D geometric transformation, `U` has size l-by-3 and the third column lists the z-coordinate of the points to transform.

Data Types: `single` | `double`

## Output Arguments

collapse all

x-coordinates of points after transformation, returned as an m-by-n or m-by-n-by-p numeric array. The number of dimensions of `x` matches the dimensionality of `tform`.

Data Types: `single` | `double`

y-coordinates of points after transformation, returned as an m-by-n or m-by-n-by-p numeric array. The size of `y` matches the size of `x`.

Data Types: `single` | `double`

z-coordinates of points after transformation, returned as an m-by-n-by-p numeric array. The size of `z` matches the size of `x`.

Data Types: `single` | `double`

Coordinates of points after transformation, returned as a numeric array. The size of `X` matches the size of `U`.

The first column lists the x-coordinate of each point after transformation, and the second column lists the y-coordinate. If `tform` represents a 3-D geometric transformation, the third column lists the z-coordinate of the points after transformation.

Data Types: `single` | `double`